Projecting a point in 3D space

Blitz3D Forums/Blitz3D Beginners Area/Projecting a point in 3D space

Robert(Posted 2004) [#1]
Hi,

Can anyone tell me how to project a point in 3D space?

For example, if I am at 0,0,0, and I move 10 units at an angle of 45 degrees, how do I work out my final x/y/z coords?

I know that you can just rotate and move an entity the distance and store its new position, but I would like to know the maths way of doing it.


Andy(Posted 2004) [#2]
Use cos and sin

http://www.blitzbasic.com/b3ddocs/command.php?name=Cos&ref=2d_cat


Andy


Jeppe Nielsen(Posted 2004) [#3]
Or use TFormPoint:

p=CreatePivot()

RotateEntity p,0,45,0

TFormPoint 0,0,10,p,0

x#=TFormedX()
y#=TFormedY()
z#=TFormedZ()