MP3D Engine Alpha 33

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: MP3D Engine Alpha 31

Post by mpz »

Hello leonard,

the code "changeing fullscreen to windows" works, but yor windows is to big for changing. It is a limit of DX9, not of mp3d. If you use 800x600, everything works fine. Please test other resolutions.

thx to applePi, you found the mistake and the solution...

i like all demos for mp3d, thanks

Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: MP3D Engine Alpha 31

Post by leonhardt »

Oh my,what a mistake,I forgot the basic variable rules, :oops:
thanks you two!
poor English...

PureBasic & Delphi & VBA
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: MP3D Engine Alpha 31

Post by leonhardt »

mpz wrote:Hello leonard,

the code "changeing fullscreen to windows" works, but yor windows is to big for changing. It is a limit of DX9, not of mp3d. If you use 800x600, everything works fine. Please test other resolutions.

thx to applePi, you found the mistake and the solution...

i like all demos for mp3d, thanks

Greetings Michael
But I test Delphi+Ashpyre and Delphi+HGE ,this two engine do work well with my fullscreen mode,so I had just asked that question. :(
poor English...

PureBasic & Delphi & VBA
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: MP3D Engine Alpha 31

Post by leonhardt »

hello MPZ,why can't I register your forum?
and I have a suggestion:
1,MP_ScreenshotToTextur() may be MP_ScreenshotToTexture() because all the other texture commands are end of "-ture", :wink:
2,MP_2DPhysicCollissionInit() should be MP_2DPhysicCollisionInit() :wink:
poor English...

PureBasic & Delphi & VBA
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: MP3D Engine Alpha 31

Post by mpz »

Hello lenoardt,

sorry, but the forum must be repaired and then you can get a account. I hope the problem will solved in the next time...

I have made a new prerelease for x86 and x64. Some commands are renamed (MP_ScreenshotToTexture,MP_2DPhysicCollisionInit and some more).

Now i have 5 new commands (like the pb commands) to find the possible solution for fullscreen. Here the code:

Code: Select all

MP_ExamineScreenModes()

While MP_NextScreenMode()
  
  Debug Str(MP_ScreenModeWidth()) + " / " + Str(MP_ScreenModeHeight()) + " / " + Str(MP_ScreenModeDepth()) + " / " +   Str(MP_ScreenModeRefreshRate())

Wend
You see i will help if i could...

Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: MP3D Engine Alpha 31

Post by leonhardt »

mpz wrote:Hello lenoardt,

sorry, but the forum must be repaired and then you can get a account. I hope the problem will solved in the next time...

I have made a new prerelease for x86 and x64. Some commands are renamed (MP_ScreenshotToTexture,MP_2DPhysicCollisionInit and some more).

Now i have 5 new commands (like the pb commands) to find the possible solution for fullscreen. Here the code:

Code: Select all

MP_ExamineScreenModes()

While MP_NextScreenMode()
  
  Debug Str(MP_ScreenModeWidth()) + " / " + Str(MP_ScreenModeHeight()) + " / " + Str(MP_ScreenModeDepth()) + " / " +   Str(MP_ScreenModeRefreshRate())

Wend
You see i will help if i could...

Greetings Michael
Thanks for your reply! I'm glad to see those new commands out,hope you can keep the MP3d project alive,it's a wonderful game engine.
poor English...

PureBasic & Delphi & VBA
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: MP3D Engine Alpha 31

Post by leonhardt »

Hello MPZ,how can I do MP_SpriteSetColor(s,MP_ARGB(a,r,g,b)) stuff?
If I do it this way:

Code: Select all

t=MP_SpriteGetTexture(s)
MP_TextureSetColor(t,0,23)
MP_SpriteSetTexture(s,t)
it can only change one color value once a time, that's not so convenient, not as expected,I'm not familiar with DX programming,could you show me some methods or just add a sprite color command?
poor English...

PureBasic & Delphi & VBA
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: MP3D Engine Alpha 31

Post by mpz »

Hello leonhardt,

the question is, what exactly do you need for a kind of a command? If you set a color in the textuire it is like a fill in in and then the complet texture has one color? What do you think about a command to change one color with another color?

Like: MP_ChangeColor(texture, OldColor, NewColor); Change Oldcolor(RGB) with NewColor(RGB)

Greetings Michael


her a little code to change a color:

code]MP_Graphics3D (640,480,0,1)


If CreateImage(0, 100, 100)

StartDrawing(ImageOutput(0))

Circle(50, 50, 40, RGB(255, 0,0))
DrawingMode(#PB_2DDrawing_Transparent)
FrontColor(RGB(0,0,255)) ; print the text to white !
DrawText(30, 45, "MP3D...")

StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !

EndIf

Texture = MP_ImageToTexture(0)
sprite = MP_SpriteFromTexture(Texture)

MP_AmbientSetLight(RGB(72,61,139))

Oldcolor = RGB(255, 0,0)

While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen

x+1 : y + 1
If x > 440 : x = 0 : EndIf ; Grundzähler

MP_DrawSprite(Sprite,x,180)

If y > 10
MP_TextureSetColor(Texture, 0, Random (255))
MP_TextureSetColor(Texture, 1, Random (255))
MP_TextureSetColor(Texture, 2, Random (255))
y=0
EndIf

RGB(255, 0,0)

MP_RenderWorld() ; Erstelle die Welt
MP_Flip () ; Stelle Sie dar

Wend[/code]
Working on - MP3D Library - PB 5.73 version ready for download
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: MP3D Engine Alpha 31

Post by leonhardt »

mpz wrote:Hello leonhardt,

the question is, what exactly do you need for a kind of a command? If you set a color in the textuire it is like a fill in in and then the complet texture has one color? What do you think about a command to change one color with another color?

Like: MP_ChangeColor(texture, OldColor, NewColor); Change Oldcolor(RGB) with NewColor(RGB)

Greetings Michael


her a little code to change a color:

code]MP_Graphics3D (640,480,0,1)


If CreateImage(0, 100, 100)

StartDrawing(ImageOutput(0))

Circle(50, 50, 40, RGB(255, 0,0))
DrawingMode(#PB_2DDrawing_Transparent)
FrontColor(RGB(0,0,255)) ; print the text to white !
DrawText(30, 45, "MP3D...")

StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !

EndIf

Texture = MP_ImageToTexture(0)
sprite = MP_SpriteFromTexture(Texture)

MP_AmbientSetLight(RGB(72,61,139))

Oldcolor = RGB(255, 0,0)

While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen

x+1 : y + 1
If x > 440 : x = 0 : EndIf ; Grundzähler

MP_DrawSprite(Sprite,x,180)

If y > 10
MP_TextureSetColor(Texture, 0, Random (255))
MP_TextureSetColor(Texture, 1, Random (255))
MP_TextureSetColor(Texture, 2, Random (255))
y=0
EndIf

RGB(255, 0,0)

MP_RenderWorld() ; Erstelle die Welt
MP_Flip () ; Stelle Sie dar

Wend[/code]
hello mpz,thanks for your reply and demo,what I need is just like this function:

Code: Select all

  Structure D3DTLVERTEX
    x.f
    y.f
    z.f
    rhw.f
    Color.l
    tu.f
    tv.f
  EndStructure

  Structure PB_DX9Sprite3D
    TexRes.i                  ; TexRes
    Vertice.D3DTLVERTEX[4]    ; The 4 vertices for the rectangle sprite
    TmpVertice.D3DTLVERTEX[4] ; The 4 vertices for the rectangle sprite
    Width.l                   ; width set with ZoomSprite3D()
    Height.l                  ; height set with ZoomSprite3D()
    RealWidth.l
    RealHeight.l
    Angle.f
    Transformed.l
  EndStructure

  Procedure SetColor(Sprite3D, Color.l) ;set 3d sprite color
    Protected *Sprite3D.PB_DX9Sprite3D = IsSprite3D(Sprite3D)
    With *Sprite3D
      \Vertice[0]\Color = Color.l
      \Vertice[1]\Color = Color.l
      \Vertice[2]\Color = Color.l
      \Vertice[3]\Color = Color.l
    EndWith
  EndProcedure
but I can't catch your sprite structures, :oops:
poor English...

PureBasic & Delphi & VBA
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Re: MP3D Engine Alpha 31

Post by Sveinung »

Is it possible to include camera with the MP_MeshSetParent() command?

Sveinung
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: MP3D Engine Alpha 31

Post by mpz »

Hello leonhardt and Sveinung,

sorry for the delay, but i had no much time the last days...

@Leonhardt
In PB will be used a billboard (retancle meshs) and so you have vertex for coloring. In MP3D i use dx9 sprites and these dx9 sprites don't have vertex for coloring. In MP3D you have textures and so you can change the color of the texture. I have made an example in the MP3D forum GDI_Plus Support for textures. With these commands you can change colors of textures and with these the color of the sprites very easy...

@Sveinung
This can be a nice idea. You want to use a mesh as parent and a camera as kid?!?

Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Re: MP3D Engine Alpha 31

Post by Sveinung »

mpz wrote:Hello leonhardt and Sveinung,

@Sveinung
This can be a nice idea. You want to use a mesh as parent and a camera as kid?!?

Greetings Michael
Yes. I would like to use the mesh as a pivot to move and point the camara at the same time.
So if it is possible I would love to have this as a feature.

Here is the code where I want to rotate the camera arounde the center of the Objects.

Code: Select all

MP_Graphics3DWindow(0,0,600,480,"Sin test 3D",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
MP_FrustumCulling(1)

cam.i=MP_CreateCamera()
MP_PositionCamera(cam,0,5,-5)
MP_CameraLookAt(cam,0,0,12.5)

lig=MP_CreateLight(2)
MP_PositionEntity(lig,0,5,5)

ang.f=-0.7
t.b=0

b1.i=MP_CreateSphere(24)
MP_EntitySetColor(b1,RGB(0,255,0))
MP_PositionEntity(b1,0,0,25)

b2.i=MP_CreateSphere(24)
MP_EntitySetColor(b2,RGB(0,255,0))
MP_PositionEntity(b2,0,0,20)

b3.i=MP_CreateSphere(24)
MP_EntitySetColor(b3,RGB(0,255,0))
MP_PositionEntity(b3,0,0,15)

b4.i=MP_CreateSphere(24)
MP_EntitySetColor(b4,RGB(0,255,0))
MP_PositionEntity(b4,0,0,10)

b5.i=MP_CreateSphere(24)
MP_EntitySetColor(b5,RGB(0,255,0))
MP_PositionEntity(b5,0,0,5)

b6.i=MP_CreateSphere(24)
MP_EntitySetColor(b6,RGB(0,255,0))
MP_PositionEntity(b6,0,0,22.5)

b7.i=MP_CreateSphere(24)
MP_EntitySetColor(b7,RGB(0,255,0))
MP_PositionEntity(b7,0,0,17.5)

b8.i=MP_CreateSphere(24)
MP_EntitySetColor(b8,RGB(0,255,0))
MP_PositionEntity(b8,0,0,12.5)

b9.i=MP_CreateSphere(24)
MP_EntitySetColor(b9,RGB(0,255,0))
MP_PositionEntity(b9,0,0,7.5)


p1.i=MP_CreateCube()
MP_PositionEntity(p1,0,5,25)
MP_MeshSetParent(b1,p1)
MP_MoveEntity(b1,0,-5,0)

p2.i=MP_CreateCube()
MP_PositionEntity(p2,0,5,20)
MP_MeshSetParent(b2,p2)
MP_MoveEntity(b2,0,-5.5,0)

p3.i=MP_CreateCube()
MP_PositionEntity(p3,0,5,15)
MP_MeshSetParent(b3,p3)
MP_MoveEntity(b3,0,-6,0)

p4.i=MP_CreateCube()
MP_PositionEntity(p4,0,5,10)
MP_MeshSetParent(b4,p4)
MP_MoveEntity(b4,0,-6.5,0)

p5.i=MP_CreateCube()
MP_PositionEntity(p5,0,5,5)
MP_MeshSetParent(b5,p5)
MP_MoveEntity(b5,0,-7,0)

p6.i=MP_CreateCube()
MP_PositionEntity(p6,0,5,22.5)
MP_MeshSetParent(b6,p6)
MP_MoveEntity(b6,0,-5.25,0)

p7.i=MP_CreateCube()
MP_PositionEntity(p7,0,5,17.5)
MP_MeshSetParent(b7,p7)
MP_MoveEntity(b7,0,-5.75,0)

p8.i=MP_CreateCube()
MP_PositionEntity(p8,0,5,12.5)
MP_MeshSetParent(b8,p8)
MP_MoveEntity(b8,0,-6.25,0)

p9.i=MP_CreateCube()
MP_PositionEntity(p9,0,5,7.5)
MP_MeshSetParent(b9,p9)
MP_MoveEntity(b9,0,-6.75,0)

MP_HideEntity(p1,1)
MP_HideEntity(p2,1)
MP_HideEntity(p3,1)
MP_HideEntity(p4,1)
MP_HideEntity(p5,1)
MP_HideEntity(p6,1)
MP_HideEntity(p7,1)
MP_HideEntity(p8,1)
MP_HideEntity(p9,1)

Repeat
  ang+0.055
  MP_RotateEntity(p1,0,0,Sin(ang*2)*45)
  MP_RotateEntity(p6,0,0,Sin(ang*1.9)*47)
  MP_RotateEntity(p2,0,0,Sin(ang*1.8)*50)
  MP_RotateEntity(p7,0,0,Sin(ang*1.7)*53)
  MP_RotateEntity(p3,0,0,Sin(ang*1.6)*55)
  MP_RotateEntity(p8,0,0,Sin(ang*1.5)*57)
  MP_RotateEntity(p4,0,0,Sin(ang*1.4)*60)
  MP_RotateEntity(p9,0,0,Sin(ang*1.3)*63)
  MP_RotateEntity(p5,0,0,Sin(ang*1.2)*65)
  ;MP_DrawText(10,10,StrF(ang,4))
  MP_RenderWorld()
  MP_Flip()
Until  WindowEvent()=#PB_Event_CloseWindow Or MP_KeyHit(#PB_Key_Escape)
End
Regards
Sveinung
mpz
Enthusiast
Enthusiast
Posts: 497
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: MP3D Engine Alpha 31

Post by mpz »

Hi Sveinung,

i will have a look on it and do my best...


Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Re: MP3D Engine Alpha 31

Post by Sveinung »

@mpz
usually thats more than enough :wink:

Regards
Sveinung
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: MP3D Engine Alpha 31

Post by Psychophanta »

Last edited by Psychophanta on Wed May 22, 2013 2:17 pm, edited 1 time in total.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Post Reply