Hi,

I'm having to views, one normal 3d view and one top view with an camera icon, 
that represents the camera of the 3d view (orientation and position).
The top view (with an orthogonal projection) kann be zoomed in and zoomed out.
Of course, zooming out the top view will scale the camera icon, which I want to 
prevent. The camera icon shall have the same size at all times.
Therefore I want to use the Autotransform, but I do not get the expected 
results.

Here's how I set up the icon geometry with the AutoTransform:

                               MatrixTransform
                                              |
                                              |
                                 AutoTransform
                                              |
                                              |
                  IconGeometry (several Geodes)

The MatrixTransform controls the orientation an position of the icon.
The AutoTransform shall do the automatic scaling, so that the icon always stays 
the same size.

Here's an excerpt from the initialization code:

        cameraIcon = new osg::MatrixTransform;
        cameraIcon->setMatrix(DsTOsgMatrix4::translate(2, g_fCameraIconHeight, 
0));

        osg::ref_ptr<osg::AutoTransform> camAutoScale = new osg::AutoTransform;
        camAutoScale->setAutoScaleToScreen(true);

        cameraIcon->addChild(camAutoScale);
        camAutoScale->addChild(camBody);
        camAutoScale->addChild(camMoveHandle);
        camAutoScale->addChild(camRotateHandle);

The effect I'm getting is that the icon is not visible. If I comment out the 
line where I set the autoscaletoscreen as true, display of the icon is normal.
I guess I'm missing something in the setup of the AutoTransform.

I'm using Osg 3.0.0. Zooming is done by changing the orthogonal projection 
matrix of the view's camera appriately.
I'm using a right handed coordinate system with the z-axis as up-axis.

Do I have to set special axis in the AutoTransform?
Does the position has to be set in the AutoTransform, when the icon's position 
changes?

Can somebody help me out? Any hints are welcome.

Cheers,
Carsten

_________________________

Carsten Scharfe
Software Developer
Experiment Software ESIM

dSPACE GmbH
Rathenaustraße 26
33102 Paderborn
Germany

Tel.:  +49 5251 1638-1920
http://www.dspace.com
mailto:cscha...@dspace.de
_________________________




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

Reply via email to