I've been making my own 3d modeler for myself and for the blitz3d community. I decided to start as simple as it goes. You have to input every verticie of every triangle. The problem is I can't see any of the surfaces that you add.
Here is the code.
Graphics3D 640,480,0,2
Global newmesh = CreateMesh()
camera = CreateCamera()
MoveEntity camera,0,2,-5
light = CreateLight()
RotateEntity light,90,0,0
vcount = 0
While Not KeyDown(1)
Cls
If KeyHit(57) Then
FlushKeys()
inputsurface()
EndIf
UpdateWorld()
RenderWorld()
Flip
Wend
Function inputsurface()
tmp = CreateSurface(newmesh)
tempx# = Input("vertex1 x: ")
tempy# = Input("vertex1 y: ")
tempz# = Input("vertex1 z: ")
AddVertex(tmp,tempx#,tempy#,tempz#)
tempx# = Input("vertex2 x: ")
tempy# = Input("vertex2 y: ")
tempz# = Input("vertex2 z: ")
AddVertex(tmp,tempx#,tempy#,tempz#)
tempx# = Input("vertex3 x: ")
tempy# = Input("vertex3 y: ")
tempz# = Input("vertex3 z: ")
AddVertex(tmp,tempx#,tempy#,tempz#)
AddTriangle(tmp,0+(3*vcount),1+(3*vcount),2+(3*vcount))
vcount = vcount + 1
End Function
Does anyone know how to make this code work? Any help is appreciated.
|