In my first installer i wrote the *.lib files (d3d9.lib) in the wrong folder, the correct folder are C:\PureBasic\PureLibraries\Windows\Libraries. The new installer working correct now...
Thanks for you work, i will get your demos to the mp3d_demos in the next version...
Her comes a peace of code to add different meshs to a new one with different colors. Her you can see the new comand MP_ChangeMeshCoord(Mesh) to turn vertex with a mesh matrix:
The first new function for the next version is MP_MouseButtonHit (Button). Now you get only one trigger if you push the mousebutton ...
Greetings Michael
Code: Select all
;////////////////////////////////////////////////////////////////
;//
;// Project Title: MP 3D Engine Beispielprogramme
;// Dateiname: MP_Mesh_Create_a_new_mesh.pb
;// Erstellt am: 30.3.2011
;// Update am :
;// Author: Michael Paulwitz
;//
;// Info:
;// Mesh Create Demo
;// Demo from @graphy
;//
;////////////////////////////////////////////////////////////////
Structure D3DXVector3
x.f
y.f
z.f
EndStructure
MP_Graphics3D(800, 600, 32, 1)
MP_CreateLight(1)
cam0 = MP_CreateCamera()
MP_CameraSetRange(cam0, 4, 2048)
MP_PositionCamera(cam0, -16, -16, -22)
MP_CameraLookAt(cam0, 0, 0, 0)
;Create a empty mesh
cordx = MP_CreateMesh()
;Create the cylinder of the mesh
cyl0 = MP_CreateCylinder(10, 20)
MP_ScaleMesh(cyl0, 0.5, 0.5, 1)
MP_AddMesh(cyl0, cordx)
MP_FreeEntity(cyl0)
;Create the first cone of the mesh
con0 = MP_CreateCone(10, 4)
MP_PositionMesh(con0, 0, 0, -12)
MP_AddMesh(con0, cordx)
MP_FreeEntity(con0)
;Create the second cone of the mesh
con1 = MP_CreateCone(10, 4)
MP_RotateEntity(con1, 180, 0, 0)
MP_ChangeMeshCoord(con1)
MP_PositionMesh(con1, 0, 0, 12)
MP_AddMesh(con1, cordx)
MP_EntitySetColor(cordx, MP_ARGB(255, 0, 0, 255))
MP_FreeEntity(con1)
;Create the x+ of the mesh
xplus = MP_Create3DText("", "x+", 4)
MP_EntitySetColor(xplus, MP_ARGB(255, 255, 0, 0))
MP_PositionMesh(xplus, 5, 1, 0)
; This add the xplus mesh to the cordx mesh
MP_RotateEntity(xplus, -90, 0, 0)
MP_ChangeMeshCoord(xplus)
MP_AddMesh(xplus, cordx)
MP_FreeEntity(xplus)
;Create the x- of the mesh
xminus = MP_Create3DText("", "x-", 4)
MP_EntitySetColor(xminus, MP_ARGB(255, 0, 255, 0))
MP_PositionMesh(xminus, -9, 1, 0)
; This add the xminus mesh to the cordx mesh
MP_RotateEntity(xminus, -90, 0, 0)
MP_ChangeMeshCoord(xminus)
MP_AddMesh(xminus, cordx)
MP_FreeEntity(xminus)
MP_SaveMesh("cordx.x",cordx) ; you see a mesh with different meshs
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
MP_TurnEntity (cordx,0.1,0.1,0.1)
MP_RenderWorld()
MP_Flip()
Wend