vertex axis

Blitz3D Forums/Blitz3D Programming/vertex axis

Hi, i will grabbing vertex from cube mesh (create cube) but for doing this i have some problem..
Someone can help me?

sorry for my bad english...

So, do I understand correctly that you want to get the x,y,z coordinates of one of the vertices of a cube ? You could use GetSurface, VertexX/Y/Z and TFormPoint to do that:
Graphics3D 800, 600, 0, 2
SetBuffer BackBuffer()

WireFrame 1

camera = CreateCamera()
MoveEntity camera, 0, 0, -5

;create cube
cube = CreateCube()

Repeat

	;turn cube
	TurnEntity cube, 0.33, 0.66, 1.00
	
	RenderWorld()

	;get 1st surface
	surf = GetSurface(cube, 1)
	
	;loop through vertices
	For i = 0 To CountVertices(surf) - 1
	
		;convert mesh coordinates (original) to entity coordinates (actual)
		TFormPoint VertexX(surf, i), VertexY(surf, i), VertexZ(surf, i), cube, 0
		;read TFormedX/Y/Z to get the actual coordinates
		Text 0, i * 20, i + ": " + TFormedX() +","+ TFormedY() +","+ TFormedZ()
	
		;project xyz to get onscreen position		
		CameraProject camera, TFormedX(), TFormedY(), TFormedZ()
		;draw vertex index numbers on cube
		Text ProjectedX(), ProjectedY() + i * 4, i, 1, 1
		
	Next
	
	Flip
	
;esc = exit
Until KeyHit(1)

End


wow! thanks you very much!