Re: [osg-users] Scale object based on camera distance

2019-01-07 Thread Chris Hanson
Are you using osgEarth?

On Mon, Jan 7, 2019 at 3:38 PM David Mitchell  wrote:

> Thanks, Trajce.  That looks like it will do what I need.  Since this was
> my first post to the forums, apparently it wouldn't show up until an admin
> approved it and during that time I was able to modify the
> GeoPositionNodeAutoScaler class from osgEarth to do what I need it to.
> Looking at osg::AutoTransform, it looks like it's doing more or less the
> same thing, but is more involved.  My solution ended up being a little more
> specialized for my use case.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=75400#75400
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel  facebook.com/alphapixel (775)
623-PIXL [7495]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Scale object based on camera distance

2019-01-07 Thread David Mitchell
Thanks, Trajce.  That looks like it will do what I need.  Since this was my 
first post to the forums, apparently it wouldn't show up until an admin 
approved it and during that time I was able to modify the 
GeoPositionNodeAutoScaler class from osgEarth to do what I need it to.  Looking 
at osg::AutoTransform, it looks like it's doing more or less the same thing, 
but is more involved.  My solution ended up being a little more specialized for 
my use case.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75400#75400





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Scale object based on camera distance

2019-01-06 Thread Trajce Nikolov NICK
Hi David,

have a look at osg::AutoTransform

On Mon, Jan 7, 2019 at 1:41 AM David Mitchell  wrote:

> I have certain nodes/objects in my scene that I always want to be the same
> size regardless of their distance from the camera and I'm trying to figure
> out the best way to go about doing this.  My first thought is to create a
> custom NodeCallback to add to the node as a cull callback and then get the
> distance from the node to the camera and apply the appropriate scale to the
> node (as a MatrixTransform).  Is that a reasonable approach?
>
> The other thing I'm struggling with is how to calculate the proper scale.
> What I'd like is for the object's geometry to translate to pixel units,
> meaning if the vertices range from (-10, -10, -10) to (10, 10, 10), then it
> would take up roughly 20x20 pixels on the screen when scaled.  Rather than
> fumbling around with different matrices and transforms trying to get this
> to work, I thought I'd try asking first.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=75383#75383
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Scale object based on camera distance

2019-01-06 Thread David Mitchell
I have certain nodes/objects in my scene that I always want to be the same size 
regardless of their distance from the camera and I'm trying to figure out the 
best way to go about doing this.  My first thought is to create a custom 
NodeCallback to add to the node as a cull callback and then get the distance 
from the node to the camera and apply the appropriate scale to the node (as a 
MatrixTransform).  Is that a reasonable approach?

The other thing I'm struggling with is how to calculate the proper scale.  What 
I'd like is for the object's geometry to translate to pixel units, meaning if 
the vertices range from (-10, -10, -10) to (10, 10, 10), then it would take up 
roughly 20x20 pixels on the screen when scaled.  Rather than fumbling around 
with different matrices and transforms trying to get this to work, I thought 
I'd try asking first.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75383#75383





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org