Page 24 of 71

Re: MP3D Engine Alpha 31

Posted: Tue Mar 12, 2013 5:04 pm
by mpz
Hello Andyly,

in normal case i scroll the texture pixel for pixel and it is not possible to make a float scroll. I have another solution for you with the scrolling uv coords. Have a look on the following code. If i find another solution i inform here:

Code: Select all

;////////////////////////////////////////////////////////////////
;//
;// Project Title: MP 3D Engine Beispielprogramme
;// Dateiname: MP_ScrolleTextur2.pb
;// Erstellt am: 12.3.2013
;// Update am  : 
;// Author: Michael Paulwitz
;// 
;// Info: 
;// Textur Scrolling Demo
;// Textur Scrollen
;//
;//
;////////////////////////////////////////////////////////////////

MP_Graphics3D (640,480,0,1) ; Erstelle ein WindowsFenster #Window = 0
SetWindowTitle(0, "Vertex und Triangle Demo") 

camera=MP_CreateCamera() ; Kamera erstellen
light=MP_CreateLight(2) ; Es werde Licht


If CreateImage(0,32, 32) ; Erzeuge 6 unterschiedliche Texturseiten 

    Font = LoadFont(#PB_Any, "Arial"  , 16) 
    StartDrawing(ImageOutput(0))
    Box(0, 0, 16, 16,RGB(255,0,0))
    Box(0, 16, 16, 16,RGB(255,255,0))
    Box(16, 0, 16, 16,RGB(0,255,0))
    Box(16, 16, 16, 16,RGB(0,0,255))
    DrawingFont(FontID(Font))
    DrawingMode(#PB_2DDrawing_Transparent)
    DrawText(11,6,"5",RGB(0,0,0))
    StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !
    
EndIf

Texture = MP_ImageToTexture(0) ; Create Texture from image 
Texture2 = MP_ImageToTexture(0) ; 
Texture3 = MP_ImageToTexture(0) ; 
Texture4 = MP_ImageToTexture(0) ; 

FreeImage(0)


; Mesh 1 mit StandardVertexen
Mesh1 = MP_CreateMesh() ; Erzeuge leeres Mesh
; Erstelle 2 x drei Eckpunkte mit UV Koordinaten Textur wird einfach gemacht
MP_AddVertex (Mesh1, 1, 1,0,0,1,0) 
MP_AddVertex (Mesh1, 1,-1,0,0,1,1) 
MP_AddVertex (Mesh1,-1, 1,0,0,0,0) 
MP_AddVertex (Mesh1, 1,-1,0,0,1,1) 
MP_AddVertex (Mesh1,-1, 1,0,0,0,0) 
MP_AddVertex (Mesh1,-1,-1,0,0,0,1) 

; Erstelle zwei Dreicke = 1 x Viereck
MP_AddTriangle (Mesh1, 0,1,2)
MP_AddTriangle (Mesh1, 4,3,5)

Mesh2 = MP_CopyEntity(Mesh1)
Mesh3 = MP_CopyEntity(Mesh1)
Mesh4 = MP_CopyEntity(Mesh1)

MP_EntitySetTexture (Mesh1, Texture2 )
MP_EntitySetTexture (Mesh2, Texture )
MP_EntitySetTexture (Mesh3, Texture4 )
MP_EntitySetTexture (Mesh4, Texture3 )

MP_PositionEntity (Mesh1,-1.5,-1.5,8) ; Position des Meshs
MP_PositionEntity (Mesh2,-1.5,1.5,8) ; Position des Meshs
MP_PositionEntity (Mesh3,1.5,-1.5,8) ; Position des Meshs
MP_PositionEntity (Mesh4,1.5,1.5,8) ; Position des Meshs

MP_AmbientSetLight(RGB(20,20,134))

While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow; Esc abfrage oder Windows Schliessen
  
  
    ; Scroll methode 1
    MP_ScrollTexture(Texture, 1, 1 )
    
    
    ; Scroll methode 1
    x.f + 0.05
    If x > 1 
       MP_ScrollTexture(Texture3, 1, 1 )
       x = 0
    EndIf   
    
    ; Scroll methode 3 over uv coords
     For n = 0 To 5
          MP_VertexSetU (Mesh1,n,MP_VertexGetU (Mesh1,n)+0.0014)
          MP_VertexSetV (Mesh1,n,MP_VertexGetV (Mesh1,n)+0.0014)
     Next
     
    ; Scroll methode as Joke over uv coords
     For n = 0 To 5
          MP_VertexSetU (Mesh3,n,Sin(MP_VertexGetU (Mesh1,n)+0.002)*2)
          MP_VertexSetV (Mesh3,n,Cos(MP_VertexGetV (Mesh1,n)+0.002)*2)
     Next
     
    MP_RenderWorld() ; Erstelle die Welt
    MP_Flip () ; Stelle Sie dar

Wend

  
Greetings Michael

Re: MP3D Engine Alpha 31

Posted: Tue Mar 12, 2013 8:42 pm
by AndyLy
Oh, Thank you Michael!
True, I did not realize these vertices and triangles, so I threw them out of the code. Use MP_CreatePlane() and everything seems to be working fine.
By the way, as far as I know, the texture always scrolls by shifting UV coordinates. So this is the right decision.

Mobius Strip Demo

Posted: Fri Mar 15, 2013 2:11 pm
by applePi
Mobius strip demo,
priority: after installing MP3D v31 you need MP3D v32 from http://www.morty-productions.de/gamedev ... hp?tid=145 and replace the original sole file in C:\PureBasic\SubSystems\DX9\purelibraries\userlibraries
plotting the parametric equations:
x = Cos(u) * ( 1 + (v/2 * Cos(u/2)) )
y = Sin(u) * ( 1 + (v/2 * Cos(u/2)) )
z = v/2 * Sin(u/2)

0 <= u <= 2*Pi
-0.5 <= v <= 0.5

the code are too short and basic, it is only the controlling code wich makes it bigger ,it is not necessary (but necessary !!). usually i use a template for everything.
the width of the strip are from -0.5 to 0.5 through 2 vertices. and it goes through the whole circle ie 2*Pi . note the connection between the two end of the strip, because it is twisted each to the other and there is no up or down in mobius strip it makes a problem for me in texturing.
press W to go to wire mode, press D to delete triangles continuously, using MP_FreeTriangle(Mesh, 1) so we are always have index 1, thanks for Michael for this great feature. this is like cutting a magnet in half there are alway 2 poles. press spacebar to toggle rotate/stop then it begins rotation from the last state it was when stopping
@Michael: i have noticed in line 137 MP_ScaleEntity(Mesh,xs,ys,zs) that if xs, ys, zs go negative then the functions convert it to positive, this is why i have inserted the "If" condition to prevent this phenomena.
Image

PS: i forgot to say that to use the texture "terrain_texture.jpg" copy it from purebasic/Examples/3D/Data/Textures to the same folder of the code.

Code: Select all

#BUTTON = 6
 Quit.b = #False
rot.l=1 :stopFlag = 1 : wireFrame.b = 0
xs.f = 1:ys.f = 1:zs.f = 1
x.f: y.f :z.f: x0.f: y0.f=1 :z0.f
rotx.f:roty.f=0.5:rotz.f :rotx0.f: roty0.f: rotz0.f
up.f = 1.8: depth.f=0
ExamineDesktops()
MP_Graphics3D (DesktopWidth(0),DesktopHeight(0),0,2) ; Erstelle ein WindowsFenster #Window = 0
SetWindowTitle(0, "PgUp PgD scale mesh..Arrows for rotation, space: stop/rotate,  QA far/near, key_pad R/L/U/D") 
MP_DrawText (1,1,"press W _wireFrame, D _ delete triangles")
ButtonGadget(#BUTTON, 0, DesktopHeight(0)-60, 60, 30, "rotate/stop") 
MP_Viewport(0,0,DesktopWidth(0),DesktopHeight(0)-60)
light=MP_CreateLight(1) 
MP_PositionEntity (light,-6,0,0)
MP_EntityLookAt(light,0,0,3)
MP_LightSetColor(light,RGB(255,255,255))
InitKeyboard()
camera=MP_CreateCamera() ; Kamera erstellen
MP_PositionCamera(camera, 0, 0.5, 0)


Mesh = MP_CreateMesh() ; Erzeuge leeres Mesh
SetActiveGadget(#BUTTON)

;WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
x.f: y.f :z.f : u.f: v.f: r.f
i.l: j.l
v.f = -0.5 :  u.f=0 :txu.f : txv.f
While u <= 2*#PI
  
   While v<= 0.5
       t+1 ; total number of vertices       
       x = Cos(u) * ( 1 + (v/2 * Cos(u/2)) )
          y = Sin(u) * ( 1 + (v/2 * Cos(u/2)) )
          z = v/2 * Sin(u/2)
       
             MP_AddVertex (Mesh, x, y,z,0,txu,txv) 
         txv = txv + 1 ; texture coordinates
         v + 1
       Wend
       txv = 0
        txu = txu + 1/(2*#PI/0.1) ;texture coordinates
        v = -0.5
        u + 0.1
      Wend
      ;Debug t ; here 126 vertices from 0 to 125
      For j=0 To t-3 Step 2
         
        MP_AddTriangle (Mesh,j,j+2,j+1)
        MP_AddTriangle (Mesh,j+1,j+2,j+3 )
          
        Next 
      ;connecting the first 2 vertices index with the last 2 vertices (twisted!!!) 
      MP_AddTriangle (Mesh, 0,125,1)
      MP_AddTriangle (Mesh, 1,125,124)
      MP_EntitySetNormals(Mesh) 
;WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

Texture = MP_LoadTexture("terrain_texture.jpg")
MP_EntitySetTexture (Mesh, Texture )
MP_MaterialEmissiveColor (Texture,0,255,255,255)
MP_PositionEntity (Mesh,0,0.1,3) ; Position des Meshs
h.f=0:up.f=0.1:depth.f=3
x=90: y=0: z=0 :indx = 126
Repeat
  Event = WindowEvent()
  If Event = #PB_Event_Gadget
    Select EventGadget()
      Case #BUTTON
        If rot = 0
          rot = 1
          rotx= rotx0:roty=roty0:rotz=rotz0 ; restore rotation status
          stopFlag = 1
          
        Else
          rot = 0
          rotx0= rotx:roty0=roty:rotz0=rotz ;back up rotation status
          rotx=0:roty=0:rotz=0
          stopFlag = 0
          
        EndIf
                    
    EndSelect
  EndIf 
  If stopFlag=1
    x + rotx
    y + roty
    z + rotz
  EndIf
  MP_DrawText (1,1,"press W _wireFrame, D _ delete triangles")  
  MP_DrawText (1,15,"keyPad keys: up.down.left.right")
  MP_RotateEntity(Mesh, x, y, z)
  MP_RenderWorld() ; Erstelle die Welt
  MP_Flip ()
 
  If MP_KeyDown(#PB_Key_Up)  ; rotate left
    rotx=1:roty=0:rotz=0
    rotx0 = rotx: roty0 = roty :rotz0 = rotz
    x + rotx
    y + roty
    z + rotz
    stopFlag=0
    rot = 0
  ElseIf MP_KeyDown(#PB_Key_Down) ; rotate right
    rotx=-1:roty=0:rotz=0
    rotx0 = rotx: roty0 = roty :rotz0 = rotz
    x + rotx
    y + roty
    z + rotz
    stopFlag=0
    rot = 0
  ElseIf MP_KeyDown(#PB_Key_Right)   ; rotate up
    rotx=0:roty=1:rotz=0
    rotx0 = rotx: roty0 = roty :rotz0 = rotz
    x + rotx
    y + roty
    z + rotz
    stopFlag=0
    rot = 0
  ElseIf MP_KeyDown(#PB_Key_Left) ; rotate down
    rotx=0:roty=-1:rotz=0 
    rotx0 = rotx: roty0 = roty :rotz0 = rotz
    x + rotx
    y + roty
    z + rotz
    stopFlag=0
    rot = 0
  EndIf 
  
  If MP_KeyDown(#PB_Key_PageUp) ; scale up model
    xs.f + 0.01:ys.f + 0.01:zs.f + 0.01
    MP_ScaleEntity(Mesh,xs,ys,zs)
    
  ElseIf MP_KeyDown(#PB_Key_PageDown) ; scale down model
    xs -0.01:ys -0.01:zs- 0.01
    If xs<0 :xs=0:ys=0:zs=0:EndIf
    MP_ScaleEntity(Mesh,xs,ys,zs)
    
  EndIf
  If MP_KeyDown(#PB_Key_Pad8) ; up move
    up + 0.01
    MP_PositionEntity(Mesh,h,up,depth)
   ElseIf MP_KeyDown(#PB_Key_Pad2) ; down move
    up - 0.01
    MP_PositionEntity(Mesh,h,up,depth)
  ElseIf MP_KeyDown(#PB_Key_Pad6)
    h + 0.01
    MP_PositionEntity(Mesh,h,up,depth)
    ElseIf MP_KeyDown(#PB_Key_Pad4)
    h - 0.01
    MP_PositionEntity(Mesh,h,up,depth)
    
    ElseIf MP_KeyDown(#PB_Key_Q) ; forward move
    depth - 0.01
    MP_PositionEntity(Mesh,h,up,depth)
    ElseIf MP_KeyDown(#PB_Key_A) ; inward move
    depth + 0.01
    MP_PositionEntity(Mesh,h,up,depth)
    ElseIf MP_KeyHit(#PB_Key_W) ; display wire frame for the material
      If wireFrame=0
      MP_Wireframe (1) 
      wireFrame ! 1
         ElseIf wireFrame=1
           MP_Wireframe (0)
           wireFrame ! 1 
      EndIf
    ElseIf MP_KeyDown(#PB_Key_D) 
      MP_FreeTriangle(Mesh, 1)
       ;indx -1: MP_FreeVertex(Mesh ,indx)
        
  EndIf
   If MP_KeyDown(#PB_Key_Escape)
      Quit = #True
    EndIf
    
    
Until Quit = #True Or Event = #PB_Event_CloseWindow

Re: MP3D Engine Alpha 31

Posted: Fri Mar 15, 2013 2:15 pm
by Sveinung
Any estimate when Alpha 32 will be out for X64 ??

Regards
Sveinung

Re: MP3D Engine Alpha 31

Posted: Sun Mar 17, 2013 7:21 pm
by AndyLy
Hi Michael! Function MP_EntityAddImpulse () works for me is not right. Impulse is added only on the axis Z. Can you check?

Code: Select all

MP_Graphics3DWindow(0, 0, 1024, 768, "MP3D Physik Demo",0)
Procedure Move(*CurX, *CurY,Angle.f,Speed.f)
   PokeF(*CurX,PeekF(*CurX)+Sin(Angle*0.01745)*Speed): PokeF(*CurY,PeekF(*CurY)-Cos(Angle*0.01745)*Speed)
  EndProcedure

light0 = MP_CreateLight(2): MP_PositionEntity(light0,-400,150,-100)
camera=MP_CreateCamera(): camangleX=0: camangleZ=0: camz.f=-256: camy.f=16: camx.f=0: CamRotSpeed.f=0.07

MP_PhysicInit()

NewMaterial = MP_CreatePhysicMaterial() 
MP_SetPhysicMaterialProperties(NewMaterial,0.5,0.3,0.3)
;Global NewMaterial
nwMesh=MP_CreateSphere(24)
MP_ScaleMesh(nwMesh, 2.5,2.5,2.5)
MP_EntityPhysicBody(nwMesh, 3, 1): MP_SetPhysicMaterialtoMesh (nwMesh, NewMaterial)
MP_EntitySetColor(nwMesh,MP_ARGB(255,155,155,55)) 
MP_PositionEntity(nwMesh, 0,6,-100)

tex0 = MP_LoadTexture("F:\PUREBASIC\MP3D_30\MP3D Demos\3DPhysik\detail3.bmp")
MP_MaterialEmissiveColor(tex0, 0, 122, 132, 132)
;bodenplatte = MP_LoadMesh("F:\PUREBASIC\MP3D_30\MP3D Demos\3DPhysik\Scene2.x")
;MP_ScaleMesh( bodenplatte ,0.6,0.6,0.6)
bodenplatte = MP_CreatePlane(200,200): MP_RotateEntity(bodenplatte,90,0,0):  MP_PositionEntity(bodenplatte,0,0,-100)
MP_EntitySetTexture(bodenplatte, tex0)
MP_EntityPhysicBody(bodenplatte, 1, 0)

While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
MouseDnMb=MP_MouseButtonDown(2)
 If MouseDnMb: camangleX+MP_MouseDeltaX()* CamRotSpeed: camangleZ-MP_MouseDeltaY()* CamRotSpeed: EndIf
 If MP_KeyDown(#PB_Key_W): camspd.f=-0.5: Move(@Camz,@Camx,Int(MP_LimitTo360(CamAngleX-90)),camspd): EndIf
    If MP_KeyDown(#PB_Key_S): camspd.f=0.5: Move(@Camz,@Camx,Int(MP_LimitTo360(CamAngleX-90)),camspd): EndIf
    If MP_KeyDown(#PB_Key_A): camspd.f=0.5: Move(@Camz,@Camx,Int(MP_LimitTo360(CamAngleX)),camspd): EndIf
    If MP_KeyDown(#PB_Key_D): camspd.f=0.5: Move(@Camz,@Camx,Int(MP_LimitTo360(CamAngleX-180)),camspd): EndIf
     If MP_KeyDown(#PB_Key_PageUp): camspd.f=0.1: camy+camspd: EndIf: If MP_KeyDown(#PB_Key_PageDown): camspd.f=0.1: camy-camspd: EndIf
  MP_RotateCamera(camera,camangleX,0,camangleZ): MP_PositionCamera(camera,camx,camy,camz)

If MP_KeyDown(#PB_Key_Up): MP_EntityAddImpulse(nwMesh,0,0,1,0,0,0): EndIf
If MP_KeyDown(#PB_Key_Down): MP_EntityAddImpulse(nwMesh,0,0,-1,0,0,0): EndIf
If MP_KeyDown(#PB_Key_Left): MP_EntityAddImpulse(nwMesh,-1,0,0,0,0,0): EndIf
If MP_KeyDown(#PB_Key_Right): MP_EntityAddImpulse(nwMesh,1,0,0,0,0,0): EndIf
If MP_KeyDown(#PB_Key_Space): MP_EntityAddImpulse(nwMesh,0,10,0,0,0,0): EndIf

MP_Drawtext(10,20,StrF(camx,2)+" / "+StrF(camy,2)+" / "+StrF(camz,2))
  MP_PhysicUpdate(): MP_RenderWorld(): MP_Flip()  
Wend
MP_PhysicEnd()

Re: MP3D Engine Alpha 31

Posted: Sun Mar 17, 2013 7:44 pm
by applePi
Hi AndyLy
i have checked the MP_Physik_EntityAddForce.pb example and using the same code change line 40 in your example to:
If MP_KeyDown(#PB_Key_Left): MP_EntityAddImpulse(nwMesh,-1,0,0,MP_EntityGetX (nwMesh),MP_EntityGetY (nwMesh),MP_EntityGetZ (nwMesh)) : EndIf

now when you press Left key the ball will go left

Re: MP3D Engine Alpha 31

Posted: Sun Mar 17, 2013 8:22 pm
by AndyLy
Hi applePi,
It is strange on axis Z, everything works fine.
The idea is to coordinate the functions should be substituted as follows: centre entity plus an offset.
The Help does not say anything on this function.

P.s. MP_SetPhysicMaterialProperties(MaterialID1, Elasticity.f, staticFriction.f, kineticFriction.f [, MaterialID2])
No values ​​are affected to staticFriction and kineticFriction. Or 0.0 or 1000 - no effect.

p.p.s. Well, there is an effect, but it is weak, almost imperceptible. Balls roll for a long time. Damping of is very low.

Re: MP3D Engine Alpha 31

Posted: Sun Mar 17, 2013 10:55 pm
by mpz
Hello to all,

i hope i can help...

@ Sveinung i will make abeta version for x64 ready in the next days. The next complete version will come if the new shadow system works...

@AndyLy, the solution with MP_EntityAddImpulse(nwMesh,1,0,0,MP_EntityGetX (nwMesh),MP_EntityGetY (nwMesh),MP_EntityGetZ (nwMesh)) is correct.
I use the newton Physic and there i use the command:
http://newtondynamics.com/wiki/index.ph ... AddImpulse

With MP_SetPhysicMaterialProperties(MaterialID1, Elasticity.f, staticFriction.f, kineticFriction.f [, MaterialID2])
i use the command
http://newtondynamics.com/wiki/index.ph ... ltFriction
Have you seen th example: MP_02_Friction.pb ?

I can have look on these functions and will make some more demos

@applePi thanks for your all times good demos and help...

Greetings Michael



Perhaps you can have a

Re: MP3D Engine Alpha 31

Posted: Mon Mar 18, 2013 1:19 am
by Sveinung
@MPZ

Thank you :D

Regards
Sveinung

Re: MP3D Engine Alpha 31

Posted: Mon Mar 18, 2013 5:02 pm
by AndyLy
solution with MP_EntityAddImpulse(nwMesh,1,0,0,MP_EntityGetX (nwMesh),MP_EntityGetY (nwMesh),MP_EntityGetZ (nwMesh)) is correct.
As you like of course, but for me it is a double, unnecessary work.
Type: x = MP_EntityGetX (Mesh): MP_PositionEntity (Mesh, x ...
In any case, very few 3D Physics functions. Now I am faced with the lack of a command such as: MP_EntityGetVelocityX (Entity) , MP_EntityGetVelocityY (Entity)...
I also need a function to adjust the dumping. Vibrations are damped too long.
And something for Angle velocity, Torque.

Re: MP3D Engine Alpha 31

Posted: Thu Mar 21, 2013 10:38 am
by leonhardt
mpz wrote:Hello to all,

MP is proudly to represent my version of Alpha (31) of the mp3d engine for Windows. A few will have already seen results from it. Please install DX9 before you use it. The library has been written in PureBasic. More as 169 demo files should be easier to get started. There is a installer and if you want you can copy only the directories in the Purebasic folder. The Purebasic version from 4.61 and upper is needed. I have made an English help text, but my english is poor :oops: and i hope somebody check it and send me a better one (i dont think anybody will do that). In a file you must activated "DX9" in compiler -> library subsystem

- what is the purpose?
To make 2D and 3d games and application without using a external dll file

- open / closed source?
closed source, when I'm tired to develop the engine i will published the code

- implementation through library, dll or include?
(tailbite) library

Have fun in the 2rd and 3rd dimension

Installer for the x86 only version
http://www.flasharts.de/mpz/Install_MP3D_31_x86.exe

x86 version without installer
http://www.flasharts.de/mpz/mp3d_31_x86.zip

Installer for the x64 only version
http://www.flasharts.de/mpz/Install_MP3D_31_x64.exe

the Threadsafe only lib for x86, Please replace the original MP3D_Library lib manually
http://www.flasharts.de/mpz/Threadsafe/MP3D_Library

People who like to work on the engine or may be interested log on here. Newer versions appear in this forum
http://www.morty-productions.de/gamedev/


Important Features:
- Support for DirectX 9
- You can use many PureBasic commands directly
- Parent Kid for Sprite and Mesh available
- Sprite engine with rotating and animated sprites
- Sprite collision system, now with pixel pixel check
- Sprite manipulation commands
- mouse, joystick and Force Feedback Support
- Support Material
- Texturing with Mip Level
- Purebasic images to texture system
- Animated textures
- Different Light
- Bump mapping
- Access to Mesh Vertex
- Mesh Picking
- Mesh Animation
- Save the Meshes
- Collision system
- Fog Effect
- Integrated particle engine
- Gui of PureBasic possible
- Texture / pixel / vertex shader support
- Simple physics engine
- Primitives
- Scrolling background
- AnimParticle
- Transparenz of Meshes
- Direct Sound Effects
- Write / read pixels on Surface
- Other collision detection
- Background Scrolling
- Multiple Views
- 2D Draw functions
- fast Surface technologie
- BitmapFonts
- RenderToTexture functions
- integration of many function of the FXLib by Epyx in mp3D (Thanks to the implementation of Epyx).
- post processing with shader.
- Cullum Frustum
- Shadow
- expansion of many shader instructions
- 187 shaders total
- Shadereditor
- 2Dto3D and 3Dto2D calculations
- Physics expansion by Newton physics
- Epyx 3D and vector objects
- Some Updates and new demos
- New command expansions
- 2D Physic with Chipmunk
- Tile Engine by Epyx
- Tile converter for Tiled MapEditor => http://www.mapeditor.org/
- Some new Games

List of mesh sizes:
- Microsoft DirectX (. X, with animation support)
- B3D (. B3d)
- 3D Studio meshes (.3 ds)

Is available for the following platforms:
- Windows 98SE, ME, XP, Vista and Windows 7 (x86 abd x64)

Other functions are in progress

have fun :D
Michael Paulwitz

Maybe the first function MP_AdressOf( ) should be named MP_AddressOf( )? :wink:

Re: MP3D Engine Alpha 31

Posted: Fri Mar 22, 2013 9:37 am
by mpz
Hi leonhardt,

oh, yes this important rename of a command will happens with the next version 8)

Greetings Michael

Re: MP3D Engine Alpha 31

Posted: Sat Mar 23, 2013 8:29 am
by leonhardt
please look at this code,on my pc,the fullscreen window will flash quickly.Is there something wrong?

Code: Select all

;my pc's screen width=1920,height=1080;
MP_Graphics3D(1920,1080,0,1);If I open a width=screenwidth,height=screenheight windowed screen,it will flash when switch to fullscreen mode 
f=0
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
  MP_RenderWorld() 
  MP_Flip () 
  If MP_KeyHit(#PB_Key_Space)=1
    If f=0
      MP_FullScreenMode(1)  
      f=1
    Else
      MP_FullScreenMode(0)
      f=0
    EndIf

  EndIf

Wend
Win7 32bit pb5.11,mp3d alpha 31

PS: Is there any way or function to flip a 2D sprite horizontally or vertically?

Re: MP3D Engine Alpha 31

Posted: Tue Mar 26, 2013 3:31 pm
by leonhardt
Hey,mpz,I can't register on your forum,and this code doesn't work,could you have a look?

Code: Select all

Global dy,i,j
Procedure DrawScrollTile()
  For i= 0 To 800 Step 64
    For j = 0 To 664 Step 64
      MP_DrawSprite(s_bg,i,j-dy)
    Next
  Next
  dy+1
  If dy>63
    dy=0
  EndIf
EndProcedure

MP_Graphics3DWindow(0,0,800,600," ",$CA1001)

UsePNGImageDecoder()
CreateImage(0,64,64)
StartDrawing(ImageOutput(0))
  Box(0,0,32,32,#red)
  Box(32,32,32,32,#blue)
StopDrawing()
t=MP_ImageToTexture(0)
s_bg=MP_SpriteFromTexture(t)

Repeat
  DrawScrollTile();call mp_drawsprite from a procedure ,doesn't work;

  MP_RenderWorld()
  MP_Flip()
Until  WindowEvent()=16 Or MP_KeyDown(#PB_Key_Escape)

Code: Select all

Global dy,i,j
Procedure DrawScrollTile()
  For i= 0 To 800 Step 64
    For j = 0 To 664 Step 64
      MP_DrawSprite(s_bg,i,j-dy)
    Next
  Next
  dy+1
  If dy>63
    dy=0
  EndIf
EndProcedure

MP_Graphics3DWindow(0,0,800,600,"",$CA1001)

UsePNGImageDecoder()
CreateImage(0,64,64)
StartDrawing(ImageOutput(0))
  Box(0,0,32,32,#red)
  Box(32,32,32,32,#blue)
StopDrawing()
t=MP_ImageToTexture(0)
s_bg=MP_SpriteFromTexture(t)

Repeat
  ;DrawScrollTile()
  For i= 0 To 800 Step 64;while don't use a procedure ,it does work.
    For j = 0 To 664 Step 64
      MP_DrawSprite(s_bg,i,j-dy)
    Next
  Next
  dy+1
  If dy>63
    dy=0
  EndIf
  MP_RenderWorld()
  MP_Flip()
Until  WindowEvent()=16 Or MP_KeyDown(#PB_Key_Escape)

Re: MP3D Engine Alpha 31

Posted: Tue Mar 26, 2013 4:42 pm
by applePi
Hi leonhardt , add s_bg to the Global in line 1, it works, nice demo