Hi Sherman,

On Wed, Jun 25, 2008 at 6:31 AM, sherman wilcox
<[EMAIL PROTECTED]> wrote:
>> You could try using an osg::AutoTransform that is positioned at your
>> XYZ and set up to scale to screen coords and rotate to screen, then
>> have the subraph by offset up the Y axis (effectively in screen space)
>> to give you the offset you want.
>
> The last bit - "have the subraph by offset up the Y axis (effectively
> in screen space) to give you the offset you want." - what exactly do
> you suggest? What I require is an approximate offset in pixels. For
> example, if I want a node (lets use text as an example) to be at
> position XYZ in world coordinates and then offset by 45 pixels along
> the Y axis - what do you suggest? I have one method working that I'm
> not pleased with performance wise. The crucial bit is getting close to
> the number of pixels specified to be offset by.

The AutoTransform when scaling to screen coords tries to map a single
unit on the subgraph to a single pixel, so if you want the label to
appear 45 pixels up, then set its position to 45 units up.  You might
be able to use the pivot point to give you this local offset, i.e.
keep you subgraph in local coords you want, but then use pivot point
in this local coords that is below it, then the autotransform will
rotate around an origin that isn't the center of you subgraph, but an
offset point.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to