Hi dirk,

I was not aware of the Billboard class.
I tried it, it's working fine, but the "up" vector is not kept (meaning
that the text has still a rotation around the "through the screen"
axis).
And sometimes, it does not exactly face the screen.
Is that the intended behaviour ?

Stephane


>>> [EMAIL PROTECTED] 30/04/2008 15:58 >>>

        Hi Stephane,

Stephane Routelous wrote:
> ok, i found a way :
> 
> void display(void)
> {     
>   ViewportPtr vp = mgr->getWindow()->getPort(0);
>   int mx = vp->getPixelWidth()/2.0;
>   int my = vp->getPixelHeight()/2.0;
>   Line line = mgr->calcViewRay(mx,my);
>   Vec3f ld = line.getDirection();
>   ld*= -1;
>   Quaternion qD(Vec3f(0,0,1),ld);
> 
>   Vec3f up_temp;
>   qD.multVec(Vec3f(0,1,0), up_temp);
> 
>   Quaternion qU(up_temp, mgr->getNavigator()->getUp());
> 
>   Quaternion qResult;
>   qResult = qU;
>   qResult.mult(qD);
> 
>   Matrix m;
> 
>   m.setRotate(qResult);
> 
>   beginEditCP(theTextTrsf);
>   theTextTrsf->setMatrix(m);
>   endEditCP(theTextTrsf);
> 
>   mgr->redraw();
> }
> 
> 
> and it seems to work.
> 
> any comment ?

You can use a Billboard node, which will rotate to face the viewer 
automatically. Billboard is a Group, so you can put whatever geometry
you want 
under it.

Hope it helps

        Dirk

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100.

Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

_______________________________________________
Opensg-users mailing list
[email protected] 
https://lists.sourceforge.net/lists/listinfo/opensg-users
______________________________________________________________ 

Celebrating Excellence Since 1972. For more information, please visit 
www.rwdi.com/35th_anniversary/. 

Reputation Resources Results 

http://www.rwdi.com 

______________________________________________________________ 

This communication is intended for the sole use of the party to whom it is 
addressed and may contain information that is privileged and/or confidential. 
Any other distribution, copying or disclosure is strictly prohibited. If you 
have received this e-mail in error, please notify us immediately by telephone 
(1-519-823-1311) and delete the message without retaining any hard or 
electronic copies of same. 

RWDI scans outgoing emails for viruses, but makes no warranty as to their 
absence in this email or attachments.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to