Re: [osg-users] openGL error 'stack overflow' at after RenderBin::draw(..)

2019-01-06 Thread Nebi Sarikaya
Hi Chris;

Can you be more specific on "I usually put all of the text and HUD elements 
into a group and position them relative to the group and then rotate and shift 
that group. All the sub-children will rotate properly. " ?

Thank you!

Cheers,
Nebi

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





___
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


Re: [osg-users] Can i use MatrixTransform to transform a HUD node?

2019-01-06 Thread Terry Welsh
I have made plenty of HUD classes derived from osg::Camera. It's easy
to set it up as an orthographic or perspective projection, depending
on what look you're going for. Then I compute some simple coordinates
for the screen corners like this:

mHUDLRBT[0] = -mAspectRatio;
mHUDLRBT[1] = mAspectRatio;
mHUDLRBT[2] = -1.0f;
mHUDLRBT[3] = 1.0f;
if(mAspectRatio < 1.0f){
  mHUDLRBT[0] = -1.0f;
  mHUDLRBT[1] = 1.0f;
  mHUDLRBT[2] = -1.0f / mAspectRatio;
  mHUDLRBT[3] = 1.0f / mAspectRatio;
}

All your HUD nodes (such as osgText::Text or something derived from
MatrixTransform) can be positioned relative to those screen corners.
Every time you resize your window you should call your HUD nodes
positioning method.
- Terry

>
> Message: 5
> Date: Fri, 04 Jan 2019 14:47:01 +0100
> From: "Chen Gao" 
> To: osg-users@lists.openscenegraph.org
> Subject: [osg-users] Can i use MatrixTransform to transform a HUD
> node?
> Message-ID: <1546609621.m2f.75...@forum.openscenegraph.org>
> Content-Type: text/plain; charset=UTF-8
>
> Hi,guys
>
> Well,as the subject notes,The software in my dev job has to use a HUD to 
> show 2d pics. Generally using a camera to create a new viewport to show the 
> pic will be OK.
>
> But the 'Entity' base class for the software system uses a MT 
> (matrixtransform) to add the detailed entity node(such as basic geometry,text 
> with a geode) and then add this MT node to the root by the datacontainer 
> manager class.
>
> If I create the hud entity class derived from the base class, ie, add the 
> camera node to the MT node,does it work if I operate the move, scale commands 
> to this hud entity by using MT,not the camera? If it doesn't work, how can I 
> change the node structure to make the Hud entity responsive to the transform 
> operations which is generated by MT.Or do I only have to use the camera node 
> itself to do these transformation jobs?
>
> Please do me a favor!Thank you,guys!
>  :)
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Can i use MatrixTransform to transform a HUD node?

2019-01-06 Thread Chen Gao
Hi,guys

Well,as the subject notes,The software in my dev job has to use a HUD to 
show 2d pics. Generally using a camera to create a new viewport to show the pic 
will be OK. 

But the 'Entity' base class for the software system uses a MT 
(matrixtransform) to add the detailed entity node(such as basic geometry,text 
with a geode) and then add this MT node to the root by the datacontainer 
manager class. 

If I create the hud entity class derived from the base class, ie, add the 
camera node to the MT node,does it work if I operate the move, scale commands 
to this hud entity by using MT,not the camera? If it doesn't work, how can I 
change the node structure to make the Hud entity responsive to the transform 
operations which is generated by MT.Or do I only have to use the camera node 
itself to do these transformation jobs?

Please do me a favor!Thank you,guys!
 :)

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





___
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


Re: [osg-users] [Solved]"OSGReaderWriter wrappers failed to load" loading osg files

2019-01-06 Thread Chris Hanson
.osg is a deprecated serialization format. It is replaced by .osgt (and
.osgb for binary data).

On Sun, Jan 6, 2019 at 2:43 AM Rodrigo Dias  wrote:

> I've had a similar problem in Debian Stretch. I'm using OSG 3.6.3, which I
> build with CMake. I removed the option BUILD_OSG_DEPRECATED_SERIALIZERS,
> and included the options BUILD_OSG_APPLICATIONS, BUILD_OSG_EXAMPLES,
> BUILD_OSG_PACKAGES and BUILD_OSG_PLUGINS_BY_DEFAULT.
>
> osgviewer cessna.osg
>
> gives
>
>
> > OSGReaderWriter wrappers failed to load
> > Error reading file cessna.osg: read error (No data loaded)
> > osgviewer: No data loaded
> >
>
>
> but
>
> osgviewer cessna.osgt
>
> runs fine. So I think .osg is a deprecated format? I'm interested in using
> osgEarth, and now I wonder if I should have disabled those deprecated
> formats... (I thought that removing it could reduce the amount of errors).
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=75387#75387
>
>
>
>
>
> ___
> 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