Rotating a point about an axis or three.

BlitzMax Forums/BlitzMax Beginners Area/Rotating a point about an axis or three.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

ok here is my code. It doesn't seem to work, I meant to plot a 3d point using the Wiki's last and simple way of plotting.


This is the page again. It's the last formula the "simple version" http://en.wikipedia.org/wiki/3D_projection



Function point_3d(cam_x#,cam_y#,x3d#,y3d#,z3d#)
Local distance_x#=cam_x-x3d
Local distance_y#=cam_y-y3d
Local eye_distance#=distance_x/distance_y
Local final_x#= x3d- ((distance_x/(z3d+eye_distance)) * x3d)
Local final_y#= y3d- ((distance_y/(z3d+eye_distance)) * y3d)
SetColor 255,255,255
DrawOval final_x-1,final_y-1,2,2	
End Function

Have I made a mistake while translating it into code?