3D Space. Moving in it...?

Started by
10 comments, last by Greg K 22 years, 6 months ago
I''ve been working on a similar project and was wondering if anyone was able to get
something working using Jesper T''s solution?

IcarusXJ
Advertisement
I did something different that solved my problem.

    float fx;float fy;float fz;float ft;	// DegToRad returns the radians of a degree (My func)// fTheta = horizontal rotation// fPhi = vertical rotationfTheta = (float)DegToRad( fTheta );fPhi = (float)DegToRad( fPhi );// FCOS & FSIN are just cos & sin with a (float) typecast.fx = FCOS(fTheta) * fVel;fz = FSIN(fTheta) * fVel;fy = FSIN(fPhi) * fVel;// This was my mistake. I just left out the other half of the vertical angleft = FCOS(fPhi);fx *= ft;fz *= ft;x -= fx;z -= fz;y += fy;    


I don't know if this is mathematically correct but it works wonderfully.

Edited by - Greg K on September 26, 2001 11:53:36 PM

This topic is closed to new replies.

Advertisement