Hi Eric,

I understand that you try to get a view from above (vertical view down the
y-axis).
So far you are just translating the view, still looking in the direction of
the z-axis . You need to change your viewing up vector.
I asked the same question before, because I just could not find anything in
the tutorials.
I hope this is what you are looking for:

//vertical view (down)
TransformGroup vpTrans = u.getViewingPlatform().getViewPlatformTransform();

Point3d eye    = new Point3d(0, 10, 0);  // 10m above origin
Point3d center = new Point3d(0, 0, 0);   // origin
Vector3d up    = new Vector3d(0, 0, -1); // in neg Z direction
Transform3D t3d = new Transform3D();
t3d.lookAt(eye, center, up);
t3d.invert();
vpTrans.setTransform(t3d);

I hope this solves your problem. Otherwise feel free to ask again.
Regards,
Katja

> Can someone please help me figure this out.
>
>       GraphicsConfiguration gc =
>             SimpleUniverse.getPreferredConfiguration();
>       setLayout(new BorderLayout());
>       Canvas3D c3d   = new Canvas3D(gc);
>       add(c3d, BorderLayout.CENTER);
>       BranchGroup scene = new BranchGroup();
>       scene.addChild(new ColorCube());
>       scene.compile();
>
>       SimpleUniverse universe = new SimpleUniverse(c3d);
>       TransformGroup vpTrans  =
> universe.getViewingPlatform().getViewPlatformTransform();
>       Transform3D translate   = new Transform3D();
>       translate.setTranslation(new Vector3f(0.0f, 0.3f, 0.0f));
>       vpTrans.setTransform(translate);
>
>       universe.addBranchGraph(scene);
>
> All I'm doing is trying to set the initial view to look straight down on
> the
> color cube, the problem is all I get is a black screen. The color cube
> should be 2 meters X 2 meters X 2 meters right? and I should be setting
> the
> viewPlatform to 3 meters in the positive Y direction. So why can't I see
> anything? I've tried translating the view platform back along the Z axis
> the
> same amount..
> (0.0f, 0.0f, 0.3f) and even (0.0f, 0.0f, =0.3f) and I still get a black
> screen. Please help, this is a simple question and I'm just not
> understanding the specifics of java3d. Any help would be greatly
> appreciated. Thanks.
>
> Eric
>
>
===========================================================================
> 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".
>

--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

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