Please Sorry for my english!!
This is from Specification Java 3D:
The effects of transformations in the scene graph are cumulative. The
concatena-tion
of the transformations of each TransformGroup in a direct path from the
Locale to a Leaf node defines a composite model transformation (CMT) that
takes points in that Leaf node $B!G (Bs local coordinates and transforms them into
Vir-tual
World (Vworld) coordinates. This composite transformation is used to
trans-form
points, normals, and distances into Vworld coordinates. Points are
transformed by the CMT. Normals are transformed by the inverse-transpose of
the CMT. Distances are transformed by the scale of the CMT. In the case of a
transformation containing a nonuniform scale or shear, the maximum scale
value
in any direction is used. This ensures, for example, that a transformed
bounding
sphere, which is specified as a point and a radius, continues to enclose all
objects
that are also transformed using a nonuniform scale.
I'm going to give you a solution:
You must think that if you want to the earth rotates around the sun instead
of the origin you must make the TransformGroup that contains the earth to be
child of the TransformGroup that contains the Sun.
BG------>TG(translation,sun)---->TG(translation, rotation,
earth)
Im makin a code to help you, wait please!.
----- Original Message -----
From: "Michael Gromiha(Jouhou)970709" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 06, 2001 7:14 AM
Subject: [JAVA3D] Help: solar system
> 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".
>
===========================================================================
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".