Help with editor

Blitz3D Forums/Blitz3D Programming/Help with editor

Spike314(Posted 2008) [#1]
hi all im trying to make a level editor and what im trying to do is add something like this: [url]http://www.freewebs.com/madmanstudios/Image2.jpg[/url]

i have tryed to get this to work and failed many times here is just 1 of the methods i have tryed :
Function DrawXYZ(entity)
	CameraProject cam,EntityX(entity,1),EntityY(entity,1),EntityZ(entity,1)
	Color 0,255,0
	Line ProjectedX(),ProjectedY(),ProjectedX(),ProjectedY()+EntityPitch(cam)-50
	Text ProjectedX(),ProjectedY()-115,"Y",1
	Color 255,0,0
	Line ProjectedX(),ProjectedY(),ProjectedX()+50,ProjectedY()+EntityYaw(cam)
	Text ProjectedX()+110,ProjectedY(),"X",0,1
	
	Color 0,0,255
	Line ProjectedZ(),ProjectedY(),ProjectedZ(),ProjectedY()
	Text ProjectedX(),ProjectedY(),"Z",0,1	
	
End Function

did'nt work at as planed tho.


Dreamora(Posted 2008) [#2]
looks considerably wrong.

project all 4 points and thats it.

-> Entity X, Y, Z as well as the cases for X + dist, Y + dist, Z+ dist

and take those 4 2D coords to draw the lines / arrows.


Spike314(Posted 2008) [#3]
any chance of an example please?


Stevie G(Posted 2008) [#4]
This should work, not sure what Dreamora is on about ..

Function DrawXYZ(entity)

	;center
	CameraProject cam,EntityX(entity,1),EntityY(entity,1),EntityZ(entity,1)
	x = ProjectedX()
	y = ProjectedY()
	
	;y	
	TFormPoint 0,50,0,entity, 0
	CameraProject cam, TFormedX(), TFormedY(), TFormedZ()
	Color 0,255,0
	Line x, y, ProjectedX(), ProjectedY()	
	Text ProjectedX(), ProjectedY(), "Y", 1, 1
	
	;x	
	TFormPoint 50,0,0,entity, 0
	CameraProject cam, TFormedX(), TFormedY(), TFormedZ()
	Color 255,0,0
	Line x, y, ProjectedX(), ProjectedY()	
	Text ProjectedX(), ProjectedY(), "X", 1, 1
	
	;z
	TFormPoint 0,0,50,entity, 0
	CameraProject cam, TFormedX(), TFormedY(), TFormedZ()
	Color 0,0,255
	Line x, y, ProjectedX(), ProjectedY()	
	Text ProjectedX(), ProjectedY(), "Z", 1, 1

End Function



Spike314(Posted 2008) [#5]
great thats want i was after Thank you.

can't beleave it was that simple :)