Thanks Thomas. A good point to catch the object instantly. -Ian

-----Original Message-----
From: Thomas Gilbert Giusepe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 5:11 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Static scene vs. Camera navigated scene


Hi Ian,
To setup it inside of view, use the method lookAt. It will solve your
problem. Rgds, Thomas


>From: Ian Wang <[EMAIL PROTECTED]>
>Reply-To: Discussion list for Java 3D API <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: [JAVA3D] Static scene vs. Camera navigated scene
>Date: Mon, 19 Nov 2001 16:10:13 -0600
>
>It works finally. The problem is that my caption was out of range (outside
>of view). By adjusting its location and scale, I can see a stable
>stationary caption. So other items belonging to my background can be easily
>added. Thanks friends for your helps.
>
>Ian Wang
>   ----- Original Message -----
>   From: Ian Wang
>   To: [EMAIL PROTECTED]
>   Sent: Monday, November 19, 2001 1:34 PM
>   Subject: Re: [JAVA3D] Static scene vs. Camera navigated scene
>
>
>   Thanks Joachim, Xiaowen, and Thomas for your kind helps.
>
>   Joachim suggested to use Billboard, I believe it works. However, the
>text label (caption) will not be a completely fixed caption. It appears
>rotating back and forth a bit (not so stationary).
>
>   Thomas' method should work. I compiled your code, and it runs well. In
>my case, I didn't use keyNavigator. So I tried Xiaowen's suggestion first.
>
>   Xiaowen suggested to use ViewingPlatform.setPlatformGeometry() method to
>attach the caption to the ViewingPlatform of a SimpleUniverse. I did it as
>follows. No error message. But I cannot see my caption. How can I bring it
>in front of my eyes? Should I attach a BranchGroup node or a TransformGroup
>node?
>
>       .....
>       SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
>       PlatformGeometry pg = new PlatformGeometry();
>       pg.addChild(setCaption());
>       ViewingPlatform vp = simpleU.getViewingPlatform();
>       vp.setPlatformGeometry(pg);
>       BranchGroup scene = createSceneGraph();
>       simpleU.addBranchGraph(scene);
>       .....
>
>       public BranchGroup setCaption()
>       {
>           BranchGroup captionBG = new BranchGroup();
>           TransformGroup captionTG = new TransformGroup();
>           String fontName  = "TestFont";
>           String textString ="This is my Caption";
>           float len = textString.length();
>
>           Color3f textColor = new Color3f(0.7f, 0.8f, 0.6f);
>           Material text = new
>Material(textColor,CONSTANTS.black,textColor,
>                     CONSTANTS.white,100.0f);
>           text.setLightingEnable(true);
>
>           Appearance appearText = new Appearance();
>           appearText.setMaterial(text);
>
>           Line2D.Float height = new Line2D.Float(0.0f, 0.0f, 1.2f, 0.0f);
>           Font3D f3d = new Font3D(new Font(fontName,Font.PLAIN,2),
>                     new FontExtrusion(height));
>           Text3D txt = new Text3D(f3d,textString,
>                     new Point3f(-(len-1)/2,8.5f,0.0f),Text3D.ALIGN_FIRST,
>Text3D.PATH_RIGHT);
>
>           Shape3D textShape = new Shape3D();
>           textShape.setGeometry(txt);
>           textShape.setAppearance(appearText);
>
>           Transform3D tex = new Transform3D();
>           tex.set(new Vector3f(50.0f, 50.0f, 222.0f));  <----- location of
>my caption
>           captionTG.setTransform(tex);
>
>           captionTG.addChild(textShape);
>           captionBG.addChild(captionTG);
>           return captionBG;
>        }
>
>   I guess I didn't use the correct TransformGroup.
>
>   Ian Wang
>     >From: "Wang, Lihui"
>     >Reply-To: Discussion list for Java 3D API
>     >To: [EMAIL PROTECTED]
>     >Subject: [JAVA3D] Static scene vs. Camera navigated scene
>     >Date: Fri, 16 Nov 2001 14:43:24 -0500
>     >
>     >Hello,
>     >
>     >I have a scene graph attached to a Simple Universe. By manipulating a
>     >camera's TransformGroup obtained through
>     >SimpleU.getViewingPlatform().getViewPlatformTransform(), It is
>possible to
>     >do a camera-based navigation through my Java 3D scene.
>     >
>     >Now, I want to add a stationary background with a static Text3D label
>to the
>     >same Canvas3D, but not to be affected by the camera's viewpoint. It
>means
>     >that no matter where the viewpoint is and no matter what the camera's
>     >orientation is, the background and the text label remain stationary
>to the
>     >viewer.
>     >
>     >Could somebody kindly give me a hint of how to do it? Is it possible
>to
>     >detach the ViewPlatform from the SimpleUniverse and attach it to a
>lower
>     >node, so the higher part of the scene graph may become stationary?
>     >
>     >Thanks.
>     >
>     >Ian Wang


_________________________________________________________________
Downloaden Sie MSN Explorer kostenlos unter http://explorer.msn.de/intl.asp

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

Reply via email to