HI Dirk -
>> What confuses me is that renderAction->push_matrix() takes a matrix 
>> argument, whereas gl's does not.
>>     
>
> RenderAction::push_matrix(Matrix m)
>
> is equivalent to
>
> glPushMatrix()
> glMultMatrix(m)
>
> The pops are the same. There is no equivalent of glLoadIdentity right 
> now. What do you need it for?
>
>   
I think I came up with a solution, but here's what I'm doing anyways.

I need to hang a target off of my camera. The "target" is really a 
transform similar to a billboard which rotates to face the camera. I 
need the target to always be a fixed offset from the camera position 
(that is, its position in world coords, relative to world coords, not 
relative to the camera orientation).

I already use billboards attached to transforms to place objects on the 
screen at a fixed position, regardless of camera orientation. In the 
present case the target needs to reside at a fixed distance from the 
camera, but the user must steer towards the target, which the evil and 
tricky experimenter moves about.

My original intent was to simply make a simple transform and push it 
onto the stack -- after clearing the stack with something like

glPushMatrix()
glLoadIdentity()
glMultMatrix(myTrans)

but I ran into trouble with RenderAction and my misunderstanding 
(clarified with your replies - thanks).

I had already made this work -- but only when I attached my node to the 
scene root - I hadn't been able to apply it to any sub-nodes.

Over the weekend I took some time to understand how the billboards work 
and was able to lift a portion of the billboard code (where the axis of 
rotation == null and alignToScreen==true) and, with a slight 
modification to one of the translations, make it apply to my situation. 
Now I've got a more generally useful NodeCore, and (I think) a better 
handle on yet another aspect of OpenSG.

Thanks again for all your help!

Dan






-- 
Daniel J. Sperka
UC Davis Center for Neuroscience


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to