un exemple pour convertir tes données en mesh . Il suffit de remplacer le v par MeshVertexPosition() et le f par MeshFace()
Code : Tout sélectionner
IncludeFile "Screen3DRequester.pb"
If InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()
If Screen3DRequester()
;- Create a mesh manually
; Define all the vertices and their attributes
CreateMesh(0)
MeshVertexPosition(-9.3138, -5.63431, 6.86589)
MeshVertexPosition(-9.3138, -5.91071, 7.27779)
MeshVertexPosition(-9.3138, -6.18706, 7.68969)
MeshVertexPosition(9.38702, -6.18706, 7.68969)
MeshVertexPosition(9.38702, -5.63431, 6.86589)
MeshVertexPosition(-9.3138, -8.66584, -8.11031)
MeshVertexPosition(-9.3138, -11.1446, -7.84731)
MeshVertexPosition(-9.3138, -11.4801, -7.38891)
MeshVertexPosition(-9.3138, -11.8155, -6.9305)
MeshVertexPosition(-9.3138, -11.8155, 6.77289)
MeshVertexPosition(-9.3138, -11.1446, 7.68969)
MeshVertexPosition(-9.3138, -8.66584, 7.95269)
MeshVertexPosition(-9.3138, -5.63431, -7.02351)
MeshVertexPosition(-9.3138, -6.18706, -7.84731)
MeshVertexPosition(9.38702, -8.66584, -8.11031)
MeshVertexPosition(9.38702, -11.1446, -7.84731)
MeshVertexPosition(9.38702, -6.18706, -7.84731)
MeshVertexPosition(9.38702, -5.63431, -7.02351)
MeshVertexPosition(9.38702, -5.91071, -7.43541)
MeshVertexPosition(9.38702, -8.66584, 7.95269)
MeshVertexPosition(9.38702, -11.1446, 7.68969)
MeshVertexPosition(9.38702, -11.8155, 6.77289)
MeshVertexPosition(9.38702, -11.8155, -6.9305)
; Define all the faces, based on the vertex index
MeshFace( 8, 16, 9)
MeshFace( 7, 16, 8)
MeshFace(16, 23, 9)
MeshFace( 9, 23, 10)
MeshFace(23, 22, 10)
MeshFace(22, 11, 10)
MeshFace(21, 11, 22)
MeshFace(20, 12, 21)
MeshFace(21, 12, 11)
MeshFace(20, 3, 12)
MeshFace( 4, 3, 20)
MeshFace(17, 19, 15)
MeshFace(19, 18, 15)
MeshFace(15, 18, 23)
MeshFace(18, 5, 23)
MeshFace(23, 5, 22)
MeshFace( 5, 20, 22)
MeshFace( 5, 4, 20)
MeshFace(20, 21, 22)
MeshFace(16, 15, 23)
MeshFace(18, 13, 1)
MeshFace( 5, 18, 1)
MeshFace(18, 19, 14)
MeshFace(19, 17, 14)
MeshFace(13, 18, 14)
MeshFace(14, 17, 6)
MeshFace(17, 15, 6)
MeshFace( 6, 15, 7)
MeshFace(15, 16, 7)
MeshFace( 3, 2, 9)
MeshFace( 2, 1, 9)
MeshFace( 1, 6, 9)
MeshFace( 6, 8, 9)
MeshFace( 6, 7, 8)
MeshFace(12, 3, 9)
MeshFace( 1, 13, 6)
MeshFace(12, 9, 10)
MeshFace(13, 14, 6)
MeshFace(11, 12, 10)
MeshFace( 1, 2, 4)
MeshFace( 4, 2, 3)
MeshFace( 5, 1, 4)
FinishMesh(#True)
;-Entity
CreateEntity(0, MeshID(0), #PB_Material_None)
ScaleEntity(0, 10, 10, 10)
;-Camera
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 0, 500, #PB_Absolute)
CameraBackColor(0, RGB(80, 20, 20))
Repeat
Screen3DEvents()
ExamineMouse()
ExamineKeyboard()
RotateEntity(0, 1.1, 0.3, 1.0, #PB_Relative)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized", 0)
EndIf
End