Hi..

I am trying to write a 3D graphics routine will transform a length and two

angles into x,y,z coordinates.

L = distance of point from a constant centre of rotation (say xr,yr,zr)

A1 = Rotation in x-y plane

A2 = Rotation in x-z plane

Using these I believe I can represent the location of any point in 3D space?

Am I right...?

For displaying on the screen I need to convert these to x,y,z coords. I have

been fiddling for a while with the following -

x = xr + L*SIN(A1)*COS(A2)

y = yr + L*COS(A1)

z = zr + L*SIN(A2)

When complete, I hope to be able to pass this routine a couple of angles, and

it will draw a shape rotated by those angles, as shown here -

x = xr + L*SIN(A1 + XYOFFSET)*COS(A2 + XZOFFSET)

y = yr + L*COS(A1 + XYOFFSET)

z = zr + L*SIN(A2 + XZOFFSET)

where XYOFFSET and XZOFFSET are the rotation of the whole shape in the x-y and

x-z planes respectively.

This, however, refuses to work... and I believe it. My maths stopped after

A levels.

PPPLLLLLEEEEAAAASSSSE can someone help me... before I go completely mad!!!

Thanks in advance,

(can't think of a .sig at the mo)