Skip to main content

New to Java3D (getting a simple Sphere to grow and shrink)

1 reply [Last post]
podollb
Offline
Joined: 2006-02-17

Hi,
I want to model a sphere contracting and expanding. Is there an eay way to do this? I am just getting started with Java3D so I have very basic knowledge.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Gilson Laurent

Hello

> I want to model a sphere contracting and expanding.

So in a nutshell: scaling.

Did you find the helloworld example in the SDK ? It shows a rotating
ColorCube.

In a first step exchange the "RotationInterpolator" against a
"ScaleInterpolator" (javax.media.j3d.ScaleInterpolator). (the consturctor to
use is: ScaleInterpolator(Alpha alpha, TransformGroup target), so no big
changes)

Recompile, have a look. It should show a "contracting and expanding"
ColorCube.

Now exchange the ColorCube against a Sphere
(com.sun.j3d.utils.geometry.Sphere).

> Is there an eay way to do this?

It won't get much easier, except i write it for you ....

> I am just getting started with Java3D so I have very basic
> knowledge. ---

Don't worry, we all started that way. As long as you know a bit java,
everything fine. If you don't know java: learn the basics first....

cu
[att1.dat]