attempting to make 3d modeler

Blitz3D Forums/Blitz3D Beginners Area/attempting to make 3d modeler

Nate the Great(Posted 2008) [#1]
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.


GIB3D(Posted 2008) [#2]
Try giving the AddVertexes a name like

v1 = AddVertex
v2 = AddVertex
v3 = AddVertex

t1 = AddTriangle(tmp,v1,v2,v3)



Rob Farley(Posted 2008) [#3]
I don't mean to bring you down here, but I'm not sure you've got the experience to make a 3D modeller if you're using Input and unsure about how to add vertices etc.

Maybe lower your sights a little?


Mortiis(Posted 2008) [#4]
Plus, there is no need to create a modeler unless it's just for fun and learning. It's both hard and unneeded.


Nate the Great(Posted 2008) [#5]
Thanks for all of the help.

I think i'll give up this project.


Mortiis(Posted 2008) [#6]
Thanks for all of the help.


I assume you are being sarcastic. You can call it help actually, we just saved you from losing a lot of free time which you can work on a more useful and fun project. A game maybe.


Nate the Great(Posted 2008) [#7]
I was serious.
I realized you saved me a lot of time.


Mortiis(Posted 2008) [#8]
Oh ok then, I misunderstood, sorry.


Nate the Great(Posted 2008) [#9]
That's ok. I think we should end this post. There's not much else to be said.