3D Fundamentals...

Blitz3D Forums/Blitz3D Beginners Area/3D Fundamentals...

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

I thought I'd learn 3D now, and the fundamental parts are vertices as far as I understand (I like to understand things thoroughly(sp?)) I took the vertex example of the help and changed it like this:


Graphics3D 640,480 
SetBuffer BackBuffer() 

mesh = CreateMesh() 
surf = CreateSurface(mesh) 

	V1x# = Input$("V1.X: ")
	V1y# = Input$("V1.Y: ")
	Print ""
	V2x# = Input$("V2.X: ")
	V2y# = Input$("V2.Y: ")
	Print ""
	V3x# = Input$("V3.X: ")
	V3y# = Input$("V3.Y: ")

	Plot 320+V1x#*10,240+V1y#*10
	Plot 320+V2x#*10,240+V2y#*10
	Plot 320+V3x#*10,240+V3y#*10
	
	Print ""
	
	Print "Dare you see result (Y/N)?"
	
	While ink = 0
		ink = GetKey()
		If ink=Asc("y") Exit
	Wend
	
v2 = AddVertex (surf, V1x, V1y, 0)
v1 = AddVertex (surf, V2x, V2y, 0)
v0 = AddVertex (surf, V3x, V3y, 0)

tri = AddTriangle (surf,v0,v1,v2) 

cam = CreateCamera() 
MoveEntity cam, 0,0,-14

RenderWorld 
Flip 

WaitKey 
End  




The first part plots the x,y of the vertices of this traingle as I would think of it (after all y is still up/dn and x is still right/left in 3d, and bigger x is more right and bigger y is more down). The part that shows the 3d result confuses me. If I don't set the vertex with the lowest x,y as the last (index 2) (and so forth) nothing shows, and if I do so (as in the code above) the resulting triangle is the exact opposite of what I expected...

Assume that the first answer is 0,0, the next 5,0 and the third 0,5..