Page 62 of 71

Re: MP3D Engine Alpha 32

Posted: Wed Jan 13, 2016 12:44 am
by RASHAD
Removed

Re: MP3D Engine Alpha 32

Posted: Wed Jan 13, 2016 9:19 am
by applePi
Thank you RASHAD, now it works with x64, no polink errors. seems what was missing is the 6 files d3d9.lib d3dx9.lib dinput8.lib dsound.lib DxErr.lib dxguid.lib .

Re: MP3D Engine Alpha 32

Posted: Wed Jan 13, 2016 2:18 pm
by Joubarbe
I don't really see the point of an installer... I mean, if someone doesn't know how to extract some folders in the proper PB directory, he sure doesn't need a game engine :)

Re: MP3D Engine Alpha 32

Posted: Wed Jan 13, 2016 5:54 pm
by Psychophanta
Joubarbe wrote:I don't really see the point of an installer... I mean, if someone doesn't know how to extract some folders in the proper PB directory, he sure doesn't need a game engine :)
ยก ABSOLUTELY AGREE !
Can't be said better!
:!:

Re: MP3D Engine Alpha 32

Posted: Thu Jan 14, 2016 3:27 pm
by Psychophanta
Psychophanta wrote:There seems not to free 2DPhysics bodies nor statics entities:
Please test it in the examples of the native package.

Example:

Code: Select all

BallBody=MP_2DPhysicBodyCircle(wX/2,5 , 31, Ball, 10)
MP_FreeEntity(BallBody); <- does not free anything
I need a solution to Free the created 2D bodies, or to modify its parameters.
In fact, what i need now is to modify a 2D static line x1,y1,x2,y2 parameters at real time. Any idea or workaround?

Re: MP3D Engine Alpha 32

Posted: Thu Jan 14, 2016 8:54 pm
by applePi
Psychophanta , you said :modify a 2D static line x1,y1,x2,y2 parameters at real time, i guess you don't mean MP_LineXY but that mesh primitive of type Line List, if this is the case, look this example adapted from a tornado code which in fact made by Michael some where when i was asking for a thick points.
press 'B' to change the Lines coordinates in real time. it is may be the MP_CloseMemPrimitives(Entity) which free the primitive, not sure
regarding your first question about MP_FreeEntity(BallBody), this is surely for Michael

code not optimized

Code: Select all

#Mode = 2; #Mode = 1 or #Mode = 7

    Structure PointVertex
      x.f
      y.f
      z.f
     
      Color.l;d3dcolor
    EndStructure
    
        
    ; code for MP3D
    Declare DrawMatrix()
    Declare changePositions()
    
    Global angle.f
    
;ExamineDesktops()
;MP_Graphics3D (DesktopWidth(0),DesktopHeight(0),0,3) ; Erstelle ein WindowsFenster #Window = 0
MP_Graphics3D (800,600,0,2) 
;MP_Viewport(0,0,DesktopWidth(0),DesktopHeight(0)-5)
SetWindowTitle(0, "press 'B' to change the x,y,z of lines....press up/down to move camera, A/Z to move up.down  ")

    camera=MP_CreateCamera()

    light=MP_CreateLight(2)
    MP_LightSetColor (light, RGB(255,255,255))

        
    Global size = 300
    Global Entity= MP_CreatePrimitives (size, #Mode)   
     

    Define.f red, green, blue


    Quit.b = #False

    ;==============================================================
    
    DrawMatrix()
    MP_PrimitivesBlendingMode(Entity, 5,2)

    MP_PositionEntity(camera, 0, 0, 700)
    MP_EntityLookAt(camera,0,100,0)
    MP_PositionEntity(light, 0 , 0, 10)
    MP_EntityLookAt(light,0,0,0)
    
    MP_VSync(0)
    
    xx.f=0 :zz.f=0 : camY.f=0
    While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
     
      If MP_KeyDown(#PB_Key_Up)
       
        zz.f + 1
      ElseIf MP_KeyDown(#PB_Key_Down)
       
        zz.f - 1
     
      EndIf
      If MP_KeyDown(#PB_Key_Z)
        camY+0.3
        MP_PositionEntity(camera, 0, camY, 700)
          ElseIf MP_KeyDown(#PB_Key_A)
            camY-0.3
            MP_PositionEntity(camera, 0, camY, 700)
                          
            ElseIf MP_KeyDown(#PB_Key_B)
              changePositions()
              
            
        EndIf
         
        MP_PositionEntity(Entity, xx, 0, zz)
        ;MP_TurnEntity(Entity,0,0.1,0)
        
       
        ;changePositions(); call the routine for rotating lines
        
        MP_DrawText (1,1,"FPS = "+Str(MP_FPS()))
        
      MP_RenderWorld()
       
      MP_Flip ()

    Wend
    
    Procedure DrawMatrix()
      
      *Memory = MP_GetMemPrimitives(Entity)
      
      For i=0 To size
        x = Random(200)-100: y = Random(800)-400: z = Random(200)-100
        *myvertex.PointVertex = *Memory + i * SizeOf(PointVertex)
               
        r=0:g=255:b=0
               
        *myvertex\x = x
        *myvertex\y = y
        *myvertex\z = z
        *myvertex\color = MP_ARGB(200,r,g,b)
            
    
      Next
      
      MP_CloseMemPrimitives(Entity)
      
    EndProcedure 

    Procedure changePositions() 
      angle.f = 0.01
    
      *Memory = MP_GetMemPrimitives(Entity)
      *myvertex.PointVertex = *Memory
      
      ;*********
      For i=0 To size
         
      x.f = *myvertex\x
      z.f = *myvertex\z
           
      move + 0.01
      
      *myvertex\x = Random(200,1)
        *myvertex\z = Random(200,1)
        *myvertex\y = Random(200,1)
    
    
    *myvertex + SizeOf(PointVertex)
      
       Next
       
       MP_CloseMemPrimitives(Entity)

     EndProcedure

Re: MP3D Engine Alpha 32

Posted: Thu Jan 14, 2016 9:31 pm
by mpz
Hi to all,

@Joubarbe, i am sorry the installer installs the dx9 libs, but the libx64.zip file with the incuded dx9 files where defective on the server and so the installation went wrong. Now it works, the zip file is updated.

@Psychophanta , you can delete 2d Physic bodies with the following call MP_2DPhysicBodyRemove(Body)

Code: Select all

BallBody=MP_2DPhysicBodyCircle(wX/2,5 , 31, Ball, 10)
MP_2DPhysicBodyRemove(BallBody); <- does free 2d bodies
@applepi, nice and correct demo...

you open with MP_GetMemPrimitives(Entity) the memory of the vertex positions (xyz) and with MP_CloseMemPrimitives(Entity) close you the memmory

Here you get the coords and change them only a little bit

Code: Select all

Procedure changePositions()
      angle.f = 0.01
   
      *Memory = MP_GetMemPrimitives(Entity)
      *myvertex.PointVertex = *Memory
     
      ;*********
      For i=0 To size
         
      x.f = *myvertex\x
      z.f = *myvertex\z
           
      move + 0.01
     
      *myvertex\x = *myvertex\x + Random(5,1) - 3 ; read and change x position
       *myvertex\z = *myvertex\z + Random(5,1) - 3; read and change z position
      *myvertex\y = *myvertex\y + Random(5,1) - 3; read and change y position
   
   
    *myvertex + SizeOf(PointVertex)
     
       Next
       
       MP_CloseMemPrimitives(Entity)

     EndProcedure

Greetings Michael

Re: MP3D Engine Alpha 32

Posted: Fri Jan 15, 2016 12:26 am
by Psychophanta
mpz wrote: @Psychophanta , you can delete 2d Physic bodies with the following call MP_2DPhysicBodyRemove(Body)
Thanks, not documented.
It gives a memory access error when i do:

Code: Select all

li=MP_2DPhysicStaticLine(x1,y1,x2,y2,$AAEEBB)
MP_2DPhysicBodyRemove(li)

Re: MP3D Engine Alpha 32

Posted: Sat Jan 16, 2016 2:31 pm
by mpz
Hi to all,

i have made a new lib and i have actualized the help file with the new functions. Download manually (see first post) or with the installer.

@Psychophanta , you can delete 2d Physic bodies with the following call MP_2DPhysicBodyRemove(Body)

Hi, the command can delete dynamic and static 2D Bodies now. Before i change it, the command could only delete dynamic bodys. Please test this...

Grettings Michael

Re: MP3D Engine Alpha 32

Posted: Sat Jan 16, 2016 10:52 pm
by Psychophanta
Thanks, but:
Links broken in the first post. Can't download.

Re: MP3D Engine Alpha 32

Posted: Sun Jan 17, 2016 1:28 am
by mpz
Hi,

all Links tested

! INFO the following Installer works with PB 5.24 < 5.30 and 5.40 < 5.41
http://www.flasharts.de/mpz/mp33_beta/M ... taller.exe

pb 5.41 x86
http://www.flasharts.de/mpz/mp33_beta/d ... ibrary.zip

pb 5.41 x64
http://www.flasharts.de/mpz/mp33_beta/d ... ibrary.zip

Greetings Michael

Re: MP3D Engine Alpha 32

Posted: Sun Jan 17, 2016 9:46 am
by Psychophanta
mpz wrote:Hi to all,
i have made a new lib and i have actualized the help file with the new functions. Download manually (see first post) or with the installer.
Can't get the help file manually :?

Re: MP3D Engine Alpha 32

Posted: Sun Jan 17, 2016 12:25 pm
by mpz
Hi,

links tested

! INFO for manually installation only, for 5.40 LTS < 5.4x

Help File
www.flasharts.de/mpz/mp33_beta/Help/MP3D_Library.chm

Demofiles
www.flasharts.de/mpz/mp33_beta/Examples/MP3D_Demos.zip

32 Bit libs for PureBasic\PureLibraries\Windows\Libraries\
www.flasharts.de/mpz/mp33_beta/lib32/Lib32.zip

32 Bit MP3D_lib for PureBasic\SubSystems\dx9\purelibraries\userlibraries\
http://www.flasharts.de/mpz/mp33_beta/d ... ibrary.zip

64 Bit libs for PureBasic\PureLibraries\Windows\Libraries\
www.flasharts.de/mpz/mp33_beta/lib64/Lib64.zip

64 Bit MP3D_lib for PureBasic\SubSystems\dx9\purelibraries\userlibraries\
http://www.flasharts.de/mpz/mp33_beta/d ... ibrary.zip

Grettings Michael

Re: MP3D Engine Alpha 32

Posted: Sun Jan 17, 2016 12:51 pm
by Psychophanta
Thank you very much, Michael :)
it seems to work fine, but i am having problems with strange behaviour... but perhaps the fault is from my code...

BTW:
libs (.lib files) are not changed since long time, so no need to replace.
I put the 'MP3D_Library' file inside of
PureBasic\SubSystems\dx9\purelibraries\
instead of:
PureBasic\SubSystems\dx9\purelibraries\userlibraries\
and it works nice.

Re: MP3D Engine Alpha 32

Posted: Sun Jan 17, 2016 2:39 pm
by applePi
Hi Michael, thanks for the Update. just remarks about the old functions MP_PositionMesh and MP_ChangeMeshCoord still found in the demos
1) MP_PositionMesh
37 occurences in 13 files
using search and replace utility , these are the files

Code: Select all

Processing file : C:\MP3D Demos\Alpha\MP_AlphaTranzparenz.pb
Processing file : C:\MP3D Demos\Epyxshader\MP_Nightvision.pb
Processing file : C:\MP3D Demos\Epyxshader\MP_WobbleEffect.pb
Processing file : C:\MP3D Demos\Epyxshader\Overlay2.pb
Processing file : C:\MP3D Demos\Force Feedback\MP_ForceFeedback.pb
Processing file : C:\MP3D Demos\Mesh\MP_Mesh Achse verschoben.pb
Processing file : C:\MP3D Demos\Mesh\MP_Mesh_Create.pb
Processing file : C:\MP3D Demos\Mesh\MP_Mesh_Create2.pb
Processing file : C:\MP3D Demos\Mesh\MP_SchachDemo.pb
Processing file : C:\MP3D Demos\Mesh\MP_Spikes.pb
Processing file : C:\MP3D Demos\Shader\EffektShader\MP_BigShaderDemo.pb
Processing file : C:\MP3D Demos\Shadow\MP_ChessShadow.pb
Processing file : C:\MP3D Demos\Sound\MP_Soundeffekt.pb
Searched 195 file(s), found 37 occurrences in 13 file(s)
in file MP_Spike.pb i changed manualy MP_RotateEntity to MP_RotateMesh
MP_ShadowDemo.pb, MP_SchachDemo.pb gives invalid memory access at MP_SetMeshData(fg(...

2) removing MP_ChangeMeshCoord(...
found in 3 files MP_Spikes.pb , MP_Mesh_Create.pb, MP_Mesh_Create2.pb

i have used search and replace tool to replace MP_PositionMesh --> MP_TranslateMesh
if you want to check these edited 13 files to update the mp3d demos then here it is
http://wikisend.com/download/616388/mp3demos.rar
i enjoy mostly with the MP_Spikes.pb