You could do some things with geometry using tangents, or you could just
use Java3D to do it for you.
I assume you want the object to be "sitting on" the sphere. Assuming
the object's "up" is positive Z, look at these thoughts:
Given a selected position on the sphere (longitude, latitude) of radius
R
1. Put the object "on the surface" at the "north pole".
Transform3D xform1 = new Transform3D();
xform1.setTranslation( new Vector3f( 0f, 0f, R) );
TransformGroup tg1 = new TransformGroup( xform1 );
2. Next, rotate tg1 to the correct latitude by rotating around the
y-axis; measure angle relative to north pole: [0, 180deg] equator =
90deg, south pole 180deg
Transform3D xform2 = new Transform3D();
xform2.rotY( Math.toRadians( latitude ) );
TransformGroup tg2 = new TransformGroup( xform2 );
tg2.addChild( tg1 );
3. Finally, do the longitude, measure CCW from +x axis [0, 360deg]
Transform3D xform3 = new Transform3D();
xform3.rotZ( Math.toRadians( longitude ) );
TransformGroup tg3 = new TransformGroup( xform3 );
tg3.addChild( tg2 );
Add your shape to tg1.
I could show you how this works in diagrams, but then everybody would
think I am REALLY anal. Also, you don't "really" need all the TGs...
could just make the Transform3Ds and multiply them together and place
them in one TG.
Hope this helps...
-Lee
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".