Hi,

I am a beginner in Java 3D graphics. I am trying to make a solar system
(earth rotates the sun and the moon rotates both the earth and sun)
using
Java 3D graphics with the following steps.

1. translate the earths local system to the global systems origin
2. rotate the moon around the origin
3. translate the earths global systems to the local system origin

Now, moon rotates the earth. it is OK.

The problem is the earth is NOT rotating the sun
(earth is rotating around the origin).


I am sending the part of the program explaining the same.
Please go through it and kindly tell me where I made the mistake.
If you wish, kindly modify the program and send me the corrected one.

I think the problem is with the last step (no.3) and I am not able to
find it for the past two days. I believe one of you can rectify the
problem immediately.


I am looking for your kind reply.

Thanking you in advance.

with best regards,

Michael

======================

                // Earth rotating around the sun

                //earth from local to global system
                translate2.set(new Vector3f(0.0f,0.0f,0.0f));
                TransformGroup BallTGT2 = new
                TransformGroup(translate2);

                BallTGT2.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

                // moon rotate
                translate3.set(new Vector3f(0.2f,0.0f,0.0f));
                TransformGroup BallTGT3 = new
                TransformGroup(translate3);
                rotate3.rotX(Math.PI*2);
                TransformGroup BallTGR3 = new
                TransformGroup(rotate3);

                //translate earth to local system

                 BallTGR3.addChild(new
                Sphere(0.05f,Sphere.GENERATE_NORMALS,createAppearance()));
                BallTGT3.addChild(BallTGR3);
                scene.addChild(BallTGT3);
                 //translate3.invert();

                 // earth rotate
                 translate2.set(new Vector3f(-0.7f,0.15f,0.20f));
                 translate2.invert();
                 //TransformGroup BallTGTG2 = new
                TransformGroup(translate2);

//BallTGTG2.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
                 TransformGroup BallTGR2 = new
                TransformGroup(rotate2);
                BallTGR2.addChild(new
                Sphere(0.1f,Primitive.GENERATE_TEXTURE_COORDS,appear));
                BallTGT2.addChild(BallTGR2);
                scene.addChild(BallTGT2);


--
**********************************************************************
Dr. M. Michael Gromiha, Ph.D         Tel: 0081-298-36-9082 (Office)
Bio Informatics Lab                       0081-298-38-2956 (home)
RIKEN Tsukuba Institute              Fax: 0081-298-36-9080
The Institute of Physical and      E-mail: [EMAIL PROTECTED]
        Chemical Research (RIKEN)          [EMAIL PROTECTED]
3-1-1 Koyadai, Tsukuba, Ibaraki 305-0074
JAPAN                        URL: http://www.rtc.riken.go.jp/~gromiha
**********************************************************************

===========================================================================
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".

Reply via email to