Please show a little respect for the huge amount of work Mistrel has put in his product.
Yes, perhaps PureGDK is a slower than Dreammotion on this test (althought I've got different results on my PC: in windowed mode, 512 objects => 15-25 FPS with Dreammotion, versus 50-75 FPS with PureGDK. my specs: XP SP2, P4 3 Ghz, Intel 910 GPU => without a powerful GPU, it seems that PureGDK is much faster than Dreammotion).
But keep in mind that this test only calls very basic 3D functionnalities; in a full-fledged 3D app (layered textures, collisions, shaders, etc..), the results could be different.
Also, there's a lot of things that Dreammotion can't do yet. Example: if you look closely, you'll notice that the cubes aren't transparent for all others => there's no automatic "Z-sorting" for alphablended objects: they are always rendered in the order in which they've been created; you can see an object through another one only if the latter has been created first.
Besides, maybe Dreammotion and PureGDK are not targeted at the same audience. Take a look at the sources: PureGDK code is much simpler to understand for a novice; a lot of things are automated/provided (Wrapvalue and Curvevalue, to say the least).
If you are some code guru and you look for speed, go for C++ and tap directly into the Direct3D or OpenGL API. But if (like me) you are just a moderately skilled programmer and/or have only 1-2 hours a day left in your schedule after work and the kids' bedtime, PureGDK is perfect for the job.
See ? Please, don't say it "is not a good product"; just say it doesn't fit your (own personnal) needs.
dbDisableObjectZWrite() and dbStatistic(): oh yes, you're right. I guess I didn't look closely enough at the commands list.
And sorry, lad: I didn't mean those demos to be an argument against you.
Code: Select all
; AbstractDance Demo, "PureBasic only" version
; Author: Kelebrindae
; Date: april 02, 2006
; PB version: v4.00
; OS: Windows XP
; Demo: Yes
;- Initialisation
Resultat = MessageRequester("Abstract Dance","Full Screen ?",#PB_MessageRequester_YesNo)
If Resultat = 6
FullScreen=1
Else
FullScreen=0
EndIf
If InitEngine3D() = 0
MessageRequester( "Error" , "Can't initialize 3D, check if engine3D.dll is available" , 0 )
End
ElseIf InitSprite() = 0 Or InitKeyboard() = 0
MessageRequester( "Error" , "Can't find DirectX 7.0 or above" , 0 )
End
EndIf
If Fullscreen
OpenScreen(1024,768,32,"Abstract Dance")
Else
OpenWindow(0,0, 0, 1024 , 768,"Abstract Dance",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0, 1024 , 768,0,0,0)
EndIf
;- Data structures and definitions
Structure Vertex
px.f
py.f
pz.f
nx.f
ny.f
nz.f
Couleur.l
U.f
V.f
EndStructure
Structure FaceTri
f1.w
f2.w
f3.w
EndStructure
Enumeration
#tetrahedron
#cube
#octahedron
#dodecahedron
#icosahedron
EndEnumeration
Structure quaternion
x.f
y.f
z.f
w.f
EndStructure
Structure myVector3
x.f
y.f
z.f
EndStructure
Global cQuat.quaternion
Global pResultVector.myVector3
Structure posAngle
x.f
y.f
z.f
xangle.f
yangle.f
zangle.f
EndStructure
Global nbobjects.l = 256 ; Change this to alter the number of objects on screen
While MessageRequester("Abstract Dance","This demo will show " + Str(nbobjects) + " 3D objects." + Chr(10) + Chr(10) + "Do you want more objects?",#PB_MessageRequester_YesNo) = 6
nbobjects * 2
Wend
Global t.l=1,tmax.l=2000 ; used to store pos and rotations
Global *PtrPosAngle.posAngle,*OldPtrPosAngle.posAngle,*posAngleBuffer.l ; used to store pos and rotations
Global sizeofPosAngle.l = SizeOf(posAngle),oldPtrOffset.l = nbobjects * sizeofPosAngle
*posAngleBuffer = AllocateMemory(sizeofPosAngle*nbobjects*(tmax+100))
*oldPtrPosAngle = *posAngleBuffer
*PtrPosAngle = *posAngleBuffer + sizeofPosAngle
;- ---- Procedures ----
;************************************************************************************
; Name: CreatePlatonicMesh
; Purpose: Create a platonic solid mesh, scaled
; Parameters:
; - solide: #tetrahedron,#cube,#octahedron,#dodecahedron, or #icosahedron
; - X size
; - Y size
; - Z size
; - origin of mapping coord U
; - origin of mapping coord V
; - Vertices color
; Return value: mesh number, or -1 if an error occurs
;************************************************************************************
Procedure.l CreatePlatonicMesh(solid.l,sizeX.f,sizeY.f,sizeZ.f,Uorigin.f,Vorigin.f,Uscale.f,Vscale.f,color.l)
Protected nbVert.l , nbTri.l ; Number of vertices and faces
Protected x.f,y.f,z.f ; vertex position
Protected nx.f,ny.f,nz.f ; vertex normals
Protected u.f,v.f ; vertex UV coords (texture mapping)
Protected *PtrV.Vertex,*vertexBuffer.l ; vertices buffer in memory
Protected *PtrF.FaceTri,*facetriBuffer.l ; Faces buffer in memory
Protected newmesh.l ; Procedure Result
; Restore the good set of meshdatas
Select solid
Case #tetrahedron
Restore tetrahedron
Case #cube
Restore cube
Case #octahedron
Restore octahedron
Case #dodecahedron
Restore dodecahedron
Case #icosahedron
Restore icosahedron
Default
ProcedureReturn -1
EndSelect
; Read number of vertices and triangles
Read nbVert
Read nbTri
; Allocate the needed memory for vertices
*vertexBuffer = AllocateMemory(SizeOf(Vertex)*nbVert)
*PtrV = *vertexBuffer
; Read and store vertices position, normals, uv coords
For i = 1 To nbVert
Read x
Read y
Read z
Read nx
Read ny
Read nz
Read u
Read v
*PtrV\px = x * sizex
*PtrV\py = y * sizey
*PtrV\pz = z * sizez
*PtrV\nx = nx
*PtrV\ny = ny
*PtrV\nz = nz
*PtrV\couleur = Color
*PtrV\u = uorigin + (u * uscale)
*PtrV\v = vorigin + (v * vscale)
*PtrV + SizeOf(Vertex)
Next i
; Allocate the needed memory for faces
*facetriBuffer=AllocateMemory(SizeOf(FaceTri)*nbTri)
*PtrF=*facetriBuffer
;Read and store faces infos
For i=1 To nbTri
Read v1
Read v2
Read v3
*PtrF\f1=v1
*PtrF\f2=v2
*PtrF\f3=v3
*PtrF + SizeOf(FaceTri)
Next i
; Create mesh from stored infos
newmesh = CreateMesh(#PB_Any,100)
If IsMesh(newmesh)
SetMeshData(newmesh,#PB_Mesh_Vertex | #PB_Mesh_Normal | #PB_Mesh_UVCoordinate | #PB_Mesh_Color,*vertexBuffer,nbVert)
SetMeshData(newmesh,#PB_Mesh_Face,*facetriBuffer,nbTri)
; and don't forget to free memory
FreeMemory(*vertexBuffer)
FreeMemory(*facetriBuffer)
ProcedureReturn newmesh
Else
; even if "createMesh" has failed
FreeMemory(*vertexBuffer)
FreeMemory(*facetriBuffer)
ProcedureReturn -1
EndIf
EndProcedure
;************************************************************************************
; Name: EulerAnglesToQuat
; Purpose: convert three Euler angles X,Y,Z to a quaternion
; Parameters: X,Y,Z angles, in radians
; Return-Value: nothing, but store the result in the quaternion called "cQuat"
;************************************************************************************
Procedure EulerAnglesToQuat(x.f,y.f,z.f)
Protected roll.f,pitch.f,yaw.f
Protected cyaw.f, cpitch.f, croll.f, syaw.f, spitch.f, sroll.f
Protected cyawcpitch.f, syawspitch.f, cyawspitch.f, syawcpitch.f
Protected norm.f
roll = x
pitch= y
yaw = z
cyaw = Cos(0.5 * yaw)
cpitch = Cos(0.5 * pitch)
croll = Cos(0.5 * roll)
syaw = Sin(0.5 * yaw)
spitch = Sin(0.5 * pitch)
sroll = Sin(0.5 * roll)
cyawcpitch = cyaw*cpitch
syawspitch = syaw*spitch
cyawspitch = cyaw*spitch
syawcpitch = syaw*cpitch
norm = (cyawcpitch * croll + syawspitch * sroll)
cQuat\x = (cyawcpitch * sroll - syawspitch * croll)
cQuat\y = (cyawspitch * croll + syawcpitch * sroll)
cQuat\z = (syawcpitch * croll - cyawspitch * sroll)
cQuat\w = norm
EndProcedure
;************************************************************************************
; Name: QuaternionTransform
; Purpose: apply a myVector3 transform to the quaternion cQuat (=> translation)
; Parameters: X,Y,Z values
; Return-Value: nothing, but store the result in the myVector3 called "pResult"
;************************************************************************************
Procedure QuaternionTransform(x.f,y.f,z.f)
pResultVector\x = cQuat\w*cQuat\w*x + 2*cQuat\y*cQuat\w*z - 2*cQuat\z*cQuat\w*y + cQuat\x*cQuat\x*x + 2*cQuat\y*cQuat\x*y + 2*cQuat\z*cQuat\x*z - cQuat\z*cQuat\z*x - cQuat\y*cQuat\y*x
pResultVector\y = 2*cQuat\x*cQuat\y*x + cQuat\y*cQuat\y*y + 2*cQuat\z*cQuat\y*z + 2*cQuat\w*cQuat\z*x - cQuat\z*cQuat\z*y + cQuat\w*cQuat\w*y - 2*cQuat\x*cQuat\w*z - cQuat\x*cQuat\x*y;
pResultVector\z = 2*cQuat\x*cQuat\z*x + 2*cQuat\y*cQuat\z*y + cQuat\z*cQuat\z*z - 2*cQuat\w*cQuat\y*x - cQuat\y*cQuat\y*z + 2*cQuat\w*cQuat\x*y - cQuat\x*cQuat\x*z + cQuat\w*cQuat\w*z;
EndProcedure
;************************************************************************************
; Name: CurveValue
; Purpose: provide a smooth transition between "actuelle" and "Cible" values
; Parameters:
; - Cible : target value
; - actuelle: current value
; - P : nb steps between the two values
; Return-Value: result
;************************************************************************************
Procedure.f CurveValue(Cible.f, actuelle.f, P.f)
;Calcule une valeur progressive allant de la valeur actuelle à la valeur cible
Protected Delta.f
Delta = Cible - actuelle
If P > 1000.0
P = 1000.0
EndIf
ProcedureReturn (actuelle + ( Delta * P / 1000.0))
EndProcedure
;************************************************************************************
; Name: WrapValueF
; Purpose: provide a modulo(360) operation for floats => useful for angles
; Parameters: angle
; Return-Value: result (0 >= result < 360)
;************************************************************************************
Procedure.f wrapValueF(angle.f)
If angle < 0
ProcedureReturn angle+360
ElseIf angle >= 360
ProcedureReturn angle-360
EndIf
ProcedureReturn angle
EndProcedure
;- ---- Main program ----
; A texture and a semi-transparent material are generated to replace
; "dbGhostObjectOn" command and diffuse/ambient lighting manipulations
;-Texture
; Create a "rainbowy" 64x64 texture
CreateTexture(0,64,64)
StartDrawing(TextureOutput(0))
numstep.w=171
value.f=0
x.w=0:y.w=0
couleur.l
For mode=1 To 6
For i=1 To numstep
value=i*(255.00/numstep)
If value>255
value=255
EndIf
Select mode
Case 1
couleur = RGB(255,value,0)
Case 2
couleur = RGB(255-value,255,0)
Case 3
couleur = RGB(0,255,value)
Case 4
couleur = RGB(0,255-value,255)
Case 5
couleur = RGB(value,0,255)
Case 6
couleur = RGB(255,value,255)
EndSelect
Box(x,y,2,2,couleur)
x=x+2
If x=64
x=0
y=y+2
EndIf
Next i
Next mode
StopDrawing()
;-Material
; convert it into a semi-transparent material
CreateMaterial(0,TextureID(0))
MaterialBlendingMode(0,#PB_Material_Add)
;-Entity
; Create a bunch of cubes
colorConv.f =1024.00/nbobjects
Define numcolor.l,xt.l,yt.l,u.f,v.f
dotsize.f = 1.0/32.0
For i=0 To nbobjects-1
numcolor = i*colorConv
If numcolor < 32
numcolor=32
ElseIf numcolor > 1023
numcolor=1023
EndIf
yt=numcolor/32
xt=numcolor-(yt*32)
u=(xt/32.00)
v=(yt/32.00)
myCubeMesh = CreatePlatonicMesh(#cube,1,1,1,u,v,dotsize,dotsize,$FFFFFF)
CreateEntity(i+1,MeshID(myCubeMesh),MaterialID(0))
FreeMesh(myCubeMesh)
Next i
;-Camera
CreateCamera(0, 0, 0 , 100 , 100)
MoveCamera(0,0,0,-40)
CameraLookAt(0,0,0,0)
xtarget=1:ytarget=-18:ztarget=-8
xcam.f=CameraX(0):ycam.f=CameraY(0):zcam.f=CameraZ(0)
xcamd.f=0:ycamd.f=0:zcamd.f=0
xcamdt.f=(xtarget-xcam)/500.00:ycamdt.f=(ytarget-ycam)/500.00:zcamdt.f=(ztarget-zcam)/500.00
;-Light
; strong ambient light, for a flashy look
AmbientColor(RGB(200,200,200))
;- Variables
Define mode.l=0 ; forward or reverse motion
Define vmax.l=100,vcur.l=100,v.f=1 ; motion speed modificator
Define speed.f=0.3,var1.f=1,var2.f=2.5,var3.f=2.5 ; speed and rotation values
Define xmean.f,ymean.f,zmean.f ; Used to compute the center of the entity "swarm"
Define oldtimer.l = ElapsedMilliseconds() ; Used to cap frame rate
For i=1 To nbobjects
*ptrPosAngle\x = 0
*ptrPosAngle\y = 0
*ptrPosAngle\z = 0
*ptrPosAngle\xangle = 0
*ptrPosAngle\yangle = 0
*ptrPosAngle\zangle = 0
*ptrPosAngle+sizeOfPosAngle
Next i
;- Main loop
Repeat
If fullscreen = 0
While WindowEvent() : Wend
EndIf
xmean=0:ymean=0:zmean=0
; "Forward motion" mode
If mode=0
v=vcur/100.00
For i=1 To nbobjects
*oldPtrPosAngle = *ptrPosAngle - oldPtrOffset
*ptrPosAngle\xangle = wrapvalueF( *oldPtrPosAngle\xangle+(var1*v) )
*ptrPosAngle\yangle = wrapvalueF( *oldPtrPosAngle\yangle+(((i/100)-var2)*v) )
*ptrPosAngle\zangle = wrapvalueF( *oldPtrPosAngle\zangle+(((i/100)-var3)*v) )
; rotate cube
RotateEntity(i,*ptrPosAngle\yangle,*ptrPosAngle\xangle,*ptrPosAngle\zangle)
; a little maths to compute next position according to speed and angles
EulerAnglesToQuat(*ptrPosAngle\xangle * 0.0174533,*ptrPosAngle\yangle * 0.0174533,*ptrPosAngle\zangle * 0.0174533 )
QuaternionTransform(0,0,speed*v)
; move cube
MoveEntity( i,pResultVector\x,pResultVector\y,pResultVector\z )
*ptrPosAngle\x=EntityX(i)
*ptrPosAngle\y=EntityY(i)
*ptrPosAngle\z=EntityZ(i)
xmean+*ptrPosAngle\x
ymean+*ptrPosAngle\y
zmean+*ptrPosAngle\z
*ptrPosAngle+sizeOfPosAngle
Next i
; After tmax loops, the motion slows down until it stops
t+1
If t = tmax
vmax=-vmax
EndIf
If vmax>0 And vcur<vmax
vcur+1
EndIf
If vmax<0 And vcur>vmax
vcur-1
EndIf
; when the motion is stopped, switch to "reverse motion" mode
If vcur=0
mode=1
vcur=vmax
EndIf
Else
; "Reverse motion" mode => re-use stored positions and rotations
t-1
*ptrPosAngle-oldPtrOffset
For i=1 To nbobjects
EntityLocate( i,*ptrPosAngle\x,*ptrPosAngle\y,*ptrPosAngle\z )
RotateEntity( i,*ptrPosAngle\yangle,*ptrPosAngle\xangle,*ptrPosAngle\zangle )
xmean+*ptrPosAngle\x
ymean+*ptrPosAngle\y
zmean+*ptrPosAngle\z
*ptrPosAngle+sizeOfPosAngle
Next i
*ptrPosAngle-oldPtrOffset
If t=1
mode=0
var1=-2 + (Random(40)/10.00)
var2=-4 + (Random(80)/10.00)
var3=-4 + (Random(80)/10.00)
EndIf
EndIf
; The camera constantly flies toward random destinations
xcamd=curvevalue(xcamdt,xcamd,500.0)
ycamd=curvevalue(ycamdt,ycamd,500.0)
zcamd=curvevalue(zcamdt,zcamd,500.0)
xcam+xcamd
ycam+ycamd
zcam+zcamd
CameraLocate(0,xcam,ycam,zcam)
; Every 500 loops, the destination change
campos+1
If campos=500
xtarget=EntityX(1)+25-Random(50)
ytarget=EntityY(1)+25-Random(50)
ztarget=EntityZ(1)+25-Random(50)
xcamdt=(xtarget-xcam)/500.00
ycamdt=(ytarget-ycam)/500.00
zcamdt=(ztarget-zcam)/500.00
campos=0
EndIf
; But it always looks at the center of the entity "swarm"
xmean/nbobjects
ymean/nbobjects
zmean/nbobjects
CameraLookAt(0,xmean,ymean,zmean)
; show it all
RenderWorld()
; uncomment this to show FPS
StartDrawing(ScreenOutput())
DrawText(0,0,Str(Engine3DFrameRate(#PB_Engine3D_Average)) + " FPS / " + Str(CountRenderedTriangles()) + " triangles", $00FFFF, $BB0000)
StopDrawing()
; Flip buffers with no vSync
FlipBuffers(0)
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
FreeMemory(*posAngleBuffer)
DataSection:
tetrahedron:
; Nb sommets / Nb faces
Data.l 10,4
; Vertices: pos / normals / uv
Data.f 0.817497,0.578350,0
Data.f 0,1,0
Data.f 0.5,0.5
Data.f -0.815497,0.578350,0
Data.f 0,1,0
Data.f 0.5,1.5
Data.f 0,-0.576350,0.817497
Data.f 0,0.577351,0.816496
Data.f -0.5,1
Data.f 0,-0.576350,-0.815497
Data.f 0,0.577351,-0.816496
Data.f -0.5,1
Data.f 0,-0.576350,-0.815497
Data.f 0.816496,-0.577351,0
Data.f -0.5,1.5
Data.f 0,-0.576350,0.817497
Data.f 0.816496,-0.577351,0
Data.f 0.5,1.5
Data.f 0.817497,0.578350,0
Data.f 0.816496,-0.577351,0
Data.f 0,0.5
Data.f 0,-0.576350,-0.815497
Data.f -0.816496,-0.577351,0
Data.f -0.5,1.5
Data.f -0.815497,0.578350,0
Data.f -0.816496,-0.577351,0
Data.f 0,0.5
Data.f 0,-0.576350,0.817497
Data.f -0.816496,-0.577351,0
Data.f 0.5,1.5
; Faces
Data.l 0,1,2
Data.l 1,0,3
Data.l 4,6,5
Data.l 7,9,8
cube:
; Nb sommets / Nb faces
Data.l 24,12
; Vertices: pos / normals / uv
Data.f -0.5,0.5,-0.5
Data.f 0,1,0
Data.f 0,0
Data.f 0.5,0.5,-0.5
Data.f 0,1,0
Data.f 0,1
Data.f 0.5,0.5,0.5
Data.f 0,1,0
Data.f 1,1
Data.f -0.5,0.5,0.5
Data.f 0,1,0
Data.f 1,0
Data.f -0.5,-0.5,0.5
Data.f 0,-1,0
Data.f 0,0
Data.f 0.5,-0.5,0.5
Data.f 0,-1,0
Data.f 0,1
Data.f 0.5,-0.5,-0.5
Data.f 0,-1,0
Data.f 1,1
Data.f -0.5,-0.5,-0.5
Data.f 0,-1,0
Data.f 1,0
Data.f -0.5,0.5,0.5
Data.f 0,0,1
Data.f 0,0
Data.f 0.5,0.5,0.5
Data.f 0,0,1
Data.f 0,1
Data.f 0.5,-0.5,0.5
Data.f 0,0,1
Data.f 1,1
Data.f -0.5,-0.5,0.5
Data.f 0,0,1
Data.f 1,0
Data.f 0.5,0.5,-0.5
Data.f 0,0,-1
Data.f 0,0
Data.f -0.5,0.5,-0.5
Data.f 0,0,-1
Data.f 0,1
Data.f -0.5,-0.5,-0.5
Data.f 0,0,-1
Data.f 1,1
Data.f 0.5,-0.5,-0.5
Data.f 0,0,-1
Data.f 1,0
Data.f -0.5,0.5,-0.5
Data.f -1,0,0
Data.f 0,0
Data.f -0.5,0.5,0.5
Data.f -1,0,0
Data.f 0,1
Data.f -0.5,-0.5,0.5
Data.f -1,0,0
Data.f 1,1
Data.f -0.5,-0.5,-0.5
Data.f -1,0,0
Data.f 1,0
Data.f 0.5,0.5,0.5
Data.f 1,0,0
Data.f 0,0
Data.f 0.5,0.5,-0.5
Data.f 1,0,0
Data.f 0,1
Data.f 0.5,-0.5,-0.5
Data.f 1,0,0
Data.f 1,1
Data.f 0.5,-0.5,0.5
Data.f 1,0,0
Data.f 1,0
; Faces
Data.l 2,1,0
Data.l 0,3,2
Data.l 6,5,4
Data.l 4,7,6
Data.l 10,9,8
Data.l 8,11,10
Data.l 14,13,12
Data.l 12,15,14
Data.l 18,17,16
Data.l 16,19,18
Data.l 22,21,20
Data.l 20,23,22
octahedron:
; Nb sommets / Nb faces
Data.l 18,8
; Vertices: pos / normals / uv
Data.f 0,0.708107,0.708107
Data.f 0,1,0
Data.f 0,0.5
Data.f 0,0.708107,-0.706107
Data.f 0,1,0
Data.f 0,1.5
Data.f 1.001000,0,0
Data.f 1,0,0
Data.f 0.5,1
Data.f 0,-0.706107,0.708107
Data.f 0,0,1
Data.f -0.5,1
Data.f -0.999000,0,0
Data.f -1,0,0
Data.f 0,1.5
Data.f 0,-0.706107,-0.706107
Data.f 0,0,-1
Data.f -0.5,1
Data.f 1.001000,0,0
Data.f 0.577350,0,0.816496
Data.f 0,0.5
Data.f 0,0.708107,0.708107
Data.f 0.577350,0,0.816496
Data.f 0.5,1
Data.f 0,0.708107,0.708107
Data.f -0.577350,0,0.816496
Data.f 0.5,1
Data.f -0.999000,0,0
Data.f -0.577350,0.816496,0
Data.f -0.5,1
Data.f 0,0.708107,-0.706107
Data.f -0.577350,0,-0.816496
Data.f 0.5,1
Data.f 1.001000,0,0
Data.f 0.577350,0,-0.816496
Data.f 0,0.5
Data.f 0,0.708107,-0.706107
Data.f 0.577350,0,-0.816496
Data.f 0.5,1
Data.f 0,-0.706107,-0.706107
Data.f 0.577350,-0.816496,0
Data.f 0,1.5
Data.f 0,-0.706107,0.708107
Data.f 0.577350,-0.816496,0
Data.f 0,0.5
Data.f -0.999000,0,0
Data.f -0.577350,-0.816496,0
Data.f -0.5,1
Data.f 0,-0.706107,0.708107
Data.f -0.577350,-0.816496,0
Data.f 0,0.5
Data.f 0,-0.706107,-0.706107
Data.f -0.577350,-0.816496,0
Data.f 0,1.5
; Faces
Data.l 1,0,2
Data.l 6,7,3
Data.l 3,8,4
Data.l 9,0,1
Data.l 4,10,5
Data.l 5,12,11
Data.l 2,14,13
Data.l 15,17,16
dodecahedron:
; Nb sommets / Nb faces
Data.l 72,36
; Vertices: pos / normals / uv
Data.f 0.357822,0.935172,0
Data.f 0,0.955423,0.295242
Data.f 0.190983,1
Data.f -0.355822,0.935172,0
Data.f 0,0.955423,-0.295242
Data.f -0.190983,1
Data.f 0.578350,0.578350,0.578350
Data.f 0.688191,0.587785,0.425325
Data.f 0.309017,0.690983
Data.f 0,0.357822,0.935172
Data.f 0,0.850651,0.525731
Data.f 0,0.5
Data.f -0.576350,0.578350,0.578350
Data.f 0,0.850651,0.525731
Data.f -0.309017,0.690983
Data.f -0.576350,0.578350,-0.576350
Data.f 0,0.850651,-0.525731
Data.f -0.309017,1.309020
Data.f 0,0.357822,-0.933172
Data.f 0,0.850651,-0.525731
Data.f 0,1.5
Data.f 0.578350,0.578350,-0.576350
Data.f 0,0.850651,-0.525731
Data.f 0.309017,1.309020
Data.f 0.935172,0,0.357822
Data.f 1,0,0
Data.f 0.190983,1
Data.f 0.935172,0,-0.355822
Data.f 1,0,0
Data.f -0.190983,1
Data.f 0,-0.355822,-0.933172
Data.f 0,0,-1
Data.f -0.190983,1
Data.f 0.578350,-0.576350,-0.576350
Data.f 0.525731,0,-0.850651
Data.f -0.309017,0.690983
Data.f 0.578350,-0.576350,0.578350
Data.f 0.850651,-0.525731,0
Data.f 0.309017,1.309020
Data.f 0.357822,-0.933172,0
Data.f 0.850651,-0.525731,0
Data.f 0,1.5
Data.f -0.576350,-0.576350,-0.576350
Data.f -0.425325,-0.688191,-0.587785
Data.f -0.309017,1.309020
Data.f -0.355822,-0.933172,0
Data.f 0,-0.992447,0.122673
Data.f -0.190983,1
Data.f 0,-0.355822,0.935172
Data.f 0,-0.850651,0.525731
Data.f 0,0.5
Data.f -0.576350,-0.576350,0.578350
Data.f 0,-0.850651,0.525731
Data.f -0.309017,0.690983
Data.f -0.933172,0,-0.355822
Data.f -0.979432,-0.201774,0
Data.f -0.190983,1
Data.f -0.933172,0,0.357822
Data.f -0.992447,0.122673,0
Data.f 0.190983,1
Data.f 0.578350,0.578350,-0.576350
Data.f 0.850651,0.525731,0
Data.f -0.309017,0.690983
Data.f 0.578350,0.578350,-0.576350
Data.f 0.850651,0.525731,0
Data.f -0.309017,0.690983
Data.f 0.578350,0.578350,-0.576350
Data.f 0.850651,0.525731,0
Data.f -0.309017,0.690983
Data.f 0.357822,0.935172,0
Data.f 0.850651,0.525731,0
Data.f 0,0.5
Data.f 0.578350,0.578350,-0.576350
Data.f 0.525731,0,-0.850651
Data.f 0.309017,0.690983
Data.f 0,0.357822,-0.933172
Data.f 0.525731,0,-0.850651
Data.f 0.190983,1
Data.f 0.578350,0.578350,-0.576350
Data.f 0.525731,0,-0.850651
Data.f 0.309017,0.690983
Data.f 0.578350,0.578350,-0.576350
Data.f 0.525731,0,-0.850651
Data.f 0.309017,0.690983
Data.f 0.935172,0,-0.355822
Data.f 0.525731,0,-0.850651
Data.f 0,0.5
Data.f 0.578350,-0.576350,-0.576350
Data.f 0.850651,-0.525731,0
Data.f -0.309017,1.309020
Data.f 0.578350,-0.576350,-0.576350
Data.f 0.850651,-0.525731,0
Data.f -0.309017,1.309020
Data.f 0.578350,-0.576350,-0.576350
Data.f 0.850651,-0.525731,0
Data.f -0.309017,1.309020
Data.f 0.578350,-0.576350,-0.576350
Data.f 0,-0.850651,-0.525731
Data.f 0.309017,1.309020
Data.f 0,-0.355822,-0.933172
Data.f 0,-0.850651,-0.525731
Data.f 0,1.5
Data.f 0.578350,-0.576350,-0.576350
Data.f 0,-0.850651,-0.525731
Data.f 0.309017,1.309020
Data.f 0.578350,-0.576350,-0.576350
Data.f 0,-0.850651,-0.525731
Data.f 0.309017,1.309020
Data.f 0.357822,-0.933172,0
Data.f 0,-0.850651,-0.525731
Data.f 0.190983,1
Data.f 0.578350,-0.576350,0.578350
Data.f 0,-0.850651,0.525731
Data.f 0.309017,0.690983
Data.f 0.578350,-0.576350,0.578350
Data.f 0,-0.850651,0.525731
Data.f 0.309017,0.690983
Data.f 0.357822,-0.933172,0
Data.f 0,-0.850651,0.525731
Data.f 0.190983,1
Data.f -0.355822,-0.933172,0
Data.f -0.850651,-0.525731,0
Data.f 0,1.5
Data.f -0.355822,-0.933172,0
Data.f -0.850651,-0.525731,0
Data.f 0,1.5
Data.f -0.355822,-0.933172,0
Data.f -0.850651,-0.525731,0
Data.f 0,1.5
Data.f -0.576350,-0.576350,0.578350
Data.f -0.850651,-0.525731,0
Data.f 0.309017,1.309020
Data.f -0.933172,0,0.357822
Data.f -0.525731,0,0.850651
Data.f 0,1.5
Data.f -0.576350,0.578350,0.578350
Data.f -0.525731,0,0.850651
Data.f 0.309017,1.309020
Data.f 0,0.357822,0.935172
Data.f -0.525731,0,0.850651
Data.f 0.190983,1
Data.f -0.933172,0,0.357822
Data.f -0.525731,0,0.850651
Data.f 0,1.5
Data.f 0,0.357822,0.935172
Data.f -0.525731,0,0.850651
Data.f 0.190983,1
Data.f 0,-0.355822,0.935172
Data.f -0.525731,0,0.850651
Data.f -0.190983,1
Data.f -0.933172,0,0.357822
Data.f -0.525731,0,0.850651
Data.f 0,1.5
Data.f 0,-0.355822,0.935172
Data.f -0.525731,0,0.850651
Data.f -0.190983,1
Data.f -0.576350,-0.576350,0.578350
Data.f -0.525731,0,0.850651
Data.f -0.309017,1.309020
Data.f -0.576350,0.578350,-0.576350
Data.f -0.850651,0.525731,0
Data.f -0.309017,0.690983
Data.f -0.576350,0.578350,-0.576350
Data.f -0.850651,0.525731,0
Data.f -0.309017,0.690983
Data.f -0.355822,0.935172,0
Data.f -0.850651,0.525731,0
Data.f 0,0.5
Data.f -0.355822,0.935172,0
Data.f -0.850651,0.525731,0
Data.f 0,0.5
Data.f -0.576350,0.578350,0.578350
Data.f -0.850651,0.525731,0
Data.f 0.309017,0.690983
Data.f -0.933172,0,-0.355822
Data.f -0.525731,0,-0.850651
Data.f 0,1.5
Data.f -0.933172,0,-0.355822
Data.f -0.525731,0,-0.850651
Data.f 0,1.5
Data.f 0,0.357822,-0.933172
Data.f -0.525731,0,-0.850651
Data.f 0.190983,1
Data.f -0.933172,0,-0.355822
Data.f -0.525731,0,-0.850651
Data.f 0,1.5
Data.f 0,0.357822,-0.933172
Data.f -0.525731,0,-0.850651
Data.f 0.190983,1
Data.f -0.576350,0.578350,-0.576350
Data.f -0.525731,0,-0.850651
Data.f 0.309017,1.309020
Data.f 0,0.357822,0.935172
Data.f 0.525731,0,0.850651
Data.f 0.190983,1
Data.f 0.935172,0,0.357822
Data.f 0.525731,0,0.850651
Data.f 0,0.5
Data.f 0,0.357822,0.935172
Data.f 0.525731,0,0.850651
Data.f 0.190983,1
Data.f 0.935172,0,0.357822
Data.f 0.525731,0,0.850651
Data.f 0,0.5
Data.f 0.578350,-0.576350,0.578350
Data.f 0.525731,0,0.850651
Data.f -0.309017,0.690983
Data.f 0,0.357822,0.935172
Data.f 0.525731,0,0.850651
Data.f 0.190983,1
Data.f 0.578350,-0.576350,0.578350
Data.f 0.525731,0,0.850651
Data.f -0.309017,0.690983
Data.f 0,-0.355822,0.935172
Data.f 0.525731,0,0.850651
Data.f -0.190983,1
; Faces
Data.l 0,3,2
Data.l 0,4,3
Data.l 0,1,4
Data.l 1,6,5
Data.l 1,7,6
Data.l 1,0,7
Data.l 20,8,9
Data.l 21,2,8
Data.l 22,23,2
Data.l 24,10,25
Data.l 26,11,10
Data.l 27,28,11
Data.l 29,12,13
Data.l 30,8,12
Data.l 31,9,8
Data.l 32,14,33
Data.l 34,15,14
Data.l 35,36,15
Data.l 15,16,17
Data.l 15,37,16
Data.l 15,39,38
Data.l 40,18,14
Data.l 41,19,18
Data.l 42,43,19
Data.l 44,46,45
Data.l 47,49,48
Data.l 50,52,51
Data.l 19,53,18
Data.l 19,55,54
Data.l 19,57,56
Data.l 58,10,14
Data.l 59,60,10
Data.l 61,63,62
Data.l 64,65,2
Data.l 66,68,67
Data.l 69,71,70
icosahedron:
; Nb sommets / Nb faces
Data.l 42,20
; Vertices: pos / normals / uv
Data.f 0,0.851651,0.526731
Data.f 0,1,0
Data.f 0,0.690983
Data.f 0,0.851651,-0.524731
Data.f 0,1,0
Data.f 0,1.309020
Data.f 0.851651,0.526731,0
Data.f 0.356822,0.934172,0
Data.f 0.5,1
Data.f 0.526731,0,0.851651
Data.f 0.810146,0,0.586227
Data.f 0.5,1
Data.f -0.524731,0,0.851651
Data.f 0,0,1
Data.f 0,1.309020
Data.f -0.849651,0.526731,0
Data.f -0.934172,0.356822,0
Data.f 0,0.690983
Data.f -0.524731,0,-0.849651
Data.f -0.810146,0,-0.586227
Data.f -0.5,1
Data.f 0.526731,0,-0.849651
Data.f 0,0,-1
Data.f 0,0.690983
Data.f 0.851651,-0.524731,0
Data.f 0.934172,-0.356822,0
Data.f 0,1.309020
Data.f 0,-0.849651,-0.524731
Data.f 0,-0.356822,-0.934172
Data.f -0.5,1
Data.f 0,-0.849651,0.526731
Data.f 0,-0.707107,0.707107
Data.f 0.309017,1.5
Data.f -0.849651,-0.524731,0
Data.f -0.934172,-0.356822,0
Data.f 0,1.309020
Data.f 0.851651,0.526731,0
Data.f 0.577350,0.577350,0.577350
Data.f 0,0.690983
Data.f 0,0.851651,0.526731
Data.f 0.577350,0.577350,0.577350
Data.f 0.309017,0.5
Data.f 0.526731,0,0.851651
Data.f 0,0.356822,0.934172
Data.f 0,0.690983
Data.f 0,0.851651,0.526731
Data.f 0,0.356822,0.934172
Data.f 0.5,1
Data.f -0.524731,0,0.851651
Data.f -0.577350,0.577350,0.577350
Data.f 0.5,1
Data.f 0,0.851651,0.526731
Data.f -0.577350,0.577350,0.577350
Data.f 0.309017,0.5
Data.f -0.849651,0.526731,0
Data.f -0.356822,0.934172,0
Data.f -0.5,1
Data.f 0,0.851651,-0.524731
Data.f -0.577350,0.577350,-0.577350
Data.f -0.309017,0.5
Data.f -0.524731,0,-0.849651
Data.f 0,0.356822,-0.934172
Data.f 0,1.309020
Data.f 0,0.851651,-0.524731
Data.f 0,0.356822,-0.934172
Data.f 0.5,1
Data.f 0.526731,0,-0.849651
Data.f 0.577350,0.577350,-0.577350
Data.f -0.5,1
Data.f 0.851651,0.526731,0
Data.f 0.577350,0.577350,-0.577350
Data.f 0,0.690983
Data.f 0,0.851651,-0.524731
Data.f 0.577350,0.577350,-0.577350
Data.f -0.309017,0.5
Data.f 0.851651,0.526731,0
Data.f 0.934172,0,0.356822
Data.f 0,0.690983
Data.f 0.851651,0.526731,0
Data.f 0.934172,0,-0.356822
Data.f 0,0.690983
Data.f 0.526731,0,-0.849651
Data.f 0.934172,0,-0.356822
Data.f -0.5,1
Data.f -0.524731,0,-0.849651
Data.f 0,-0.356822,-0.934172
Data.f 0,1.309020
Data.f 0,-0.849651,-0.524731
Data.f 0.577350,-0.577350,-0.577350
Data.f -0.309017,1.5
Data.f 0.526731,0,-0.849651
Data.f 0.577350,-0.577350,-0.577350
Data.f -0.5,1
Data.f 0.851651,-0.524731,0
Data.f 0.356822,-0.934172,0
Data.f 0.5,1
Data.f 0,-0.849651,-0.524731
Data.f 0.356822,-0.934172,0
Data.f 0,1.309020
Data.f 0,-0.849651,0.526731
Data.f 0.356822,-0.934172,0
Data.f 0,0.690983
Data.f 0,-0.849651,-0.524731
Data.f -0.577350,-0.577350,-0.577350
Data.f -0.309017,1.5
Data.f -0.849651,-0.524731,0
Data.f -0.356822,-0.934172,0
Data.f -0.5,1
Data.f 0,-0.849651,0.526731
Data.f -0.356822,-0.934172,0
Data.f 0,0.690983
Data.f 0,-0.849651,-0.524731
Data.f -0.356822,-0.934172,0
Data.f 0,1.309020
Data.f 0,-0.849651,0.526731
Data.f 0,-0.356822,0.934172
Data.f -0.5,1
Data.f 0.526731,0,0.851651
Data.f 0,-0.356822,0.934172
Data.f 0,0.690983
Data.f -0.524731,0,0.851651
Data.f -0.577350,-0.577350,0.577350
Data.f 0.5,1
Data.f -0.524731,0,0.851651
Data.f -0.934172,0,0.356822
Data.f 0.5,1
; Faces
Data.l 1,0,2
Data.l 12,13,3
Data.l 14,15,4
Data.l 16,17,5
Data.l 18,0,1
Data.l 5,19,6
Data.l 20,21,7
Data.l 22,24,23
Data.l 25,3,8
Data.l 26,8,27
Data.l 28,7,9
Data.l 29,30,8
Data.l 8,3,10
Data.l 31,33,32
Data.l 6,34,11
Data.l 35,37,36
Data.l 38,39,4
Data.l 10,40,11
Data.l 6,11,5
Data.l 5,11,41
EndDataSection
[EDIT] corrected a few bugs here and there... [/EDIT]