[osg-users] Zoom effect

111 views
Skip to first unread message

Gene Permel

unread,
Jan 13, 2010, 4:07:55 AM1/13/10
to osg-...@lists.openscenegraph.org
Hi,

I want to perform zoom operation. Is there any way to do it but not like the TrackballManipulator because it does not like a zoom effect. I want picture to be doubled in size when zoomed in.

Thank you!

Cheers,
Gene

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

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

Vincent Bourdier

unread,
Jan 13, 2010, 4:20:04 AM1/13/10
to osg-...@lists.openscenegraph.org
Hi,

If you just need to change a picture size in your scene, apply it on a
geometry (a quad) and scale the transform supporting the geode.
It might be enough.

Regards,
Vincent.

Gene Permel a écrit :


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4764 (20100112) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Robert Osfield

unread,
Jan 13, 2010, 4:38:59 AM1/13/10
to osg-...@lists.openscenegraph.org
Hi Gene,

Are you after moving the eye point near your scene or keeping the eye
point the same position and adjusting the field of view?
TrackballManipulator adjusts the eye point and not the field of view.

Robert.

Gene Permel

unread,
Jan 13, 2010, 4:53:59 AM1/13/10
to osg-...@lists.openscenegraph.org
Hi,

I use the model in 3ds format can I apply geometry on 3ds? Because I load the model using readNodeFile

Thank you!

Cheers,
Gene

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=22494#22494

Robert Osfield

unread,
Jan 13, 2010, 4:59:22 AM1/13/10
to osg-...@lists.openscenegraph.org
Hi Gene,

On Wed, Jan 13, 2010 at 9:53 AM, Gene Permel <gen...@hotmail.com> wrote:
> I use the model in 3ds format can I apply geometry on 3ds? Because I load the model using readNodeFile

The model format your load from is totally independent from how you view it.

Could you please look back to my last email and try to answer the
question I asked, this will help others guide you in the right
direction, but without knowing exactly what you after there is little
we can do.

Robert.

Gene Permel

unread,
Jan 13, 2010, 5:30:57 AM1/13/10
to osg-...@lists.openscenegraph.org
Hi,

I just want to keeping the eye point the same position and adjusting the field of view.

Thank you!

Cheers,
Gene

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=22501#22501

Robert Osfield

unread,
Jan 13, 2010, 5:39:20 AM1/13/10
to osg-...@lists.openscenegraph.org
Hi Gene,

On Wed, Jan 13, 2010 at 10:30 AM, Gene Permel <gen...@hotmail.com> wrote:
> I just want to keeping the eye point the same position and adjusting the field of view.

All you need to do is adjust the viewer's Camera's projection matrix
to adjust the field of view. i.e.

viewer.getCamera()->setProjectionMatrixAsPerspective(fovy,aspectRatio,zNear,
zFar);

The convention is based gluPerspective so have a look at GLU
documation for info and what all this means.

Robert.

Gene Permel

unread,
Jan 13, 2010, 5:45:08 AM1/13/10
to osg-...@lists.openscenegraph.org
Hi,

I am already using setProjectionMatrixAsPerspective but it does not make a zoom it only changes the position of view

Thank you!

Cheers,
Gene

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=22506#22506

Robert Osfield

unread,
Jan 13, 2010, 5:52:50 AM1/13/10
to osg-...@lists.openscenegraph.org
Hi Gene,

On Wed, Jan 13, 2010 at 10:45 AM, Gene Permel <gen...@hotmail.com> wrote:
> I am already using setProjectionMatrixAsPerspective but it does not make a zoom it only changes the position of view

Camera::setViewMatrix*(..) affects the position of the view.
Camera::setProjectionMatrix*(..) has no effect whatsoever on the
position of the view, it only affects the field of view.

I sounds like you are confusing various concepts, I've done by best to
clear, but in the end I can't teach you basics of 3D graphics, I would
suggest you spend some time learning about the topic from books and
various online resources. The naming conventions used by the OSG are
the same as OpenGL so general docs on 3D graphics and OpenGL will help
you along your way.

Cheers,
Robert.

Paul Martz

unread,
Jan 13, 2010, 11:19:34 AM1/13/10
to OpenSceneGraph Users
Ditto Robert's post. The OpenSceneGraph Quick Start Guide has a good
recommended reading list towards the front of the book, which you should
find helpful.

In the meantime, consider the following two different projection matrices:
A. ...AsPerspective( 20., aspect, near, far );
B. ...AsPerspective( 40., aspect, near, far );

A has a 20 degree field of view, B has a 40 degree field of view. A is
said to be "zoomed in" compared to B. So this might be what you're
after, but really your post is to vague to say for sure whether or not
this is what you need.

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466

Gene Permel

unread,
Jan 14, 2010, 4:11:43 AM1/14/10
to osg-...@lists.openscenegraph.org
Hi,

I use the setProjectionMatrixAsPerspective that performs what I need but the only problem is when I zoom out too much, my model streches until zoom in to the previous fovy values. How could I fix this?

Thank you!

Cheers,
Gene

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=22594#22594

Ulrich Hertlein

unread,
Jan 14, 2010, 6:38:55 PM1/14/10
to osg-...@lists.openscenegraph.org
Hi Gene,

On 14/01/10 8:11 PM, Gene Permel wrote:
> I use the setProjectionMatrixAsPerspective that performs what I need but the only
> problem is when I zoom out too much, my model streches until zoom in to the previous
> fovy values. How could I fix this?

That is a common effect when you open the field-of-view of the camera. There's no way to
'fix' that because it's not broken.

You can try to move the camera (dolly in/out while keeping fov const) or use a ortho
projection and change the projection width.

Cheers,
/ulrich

Reply all
Reply to author
Forward
0 new messages