Re: [osg-users] cross axes

2012-10-12 Thread Gianni Ambrosio
For everyone will need it I'm attaching the code. Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50580#50580 Attachments: http://forum.openscenegraph.org//files/crossaxes_131.zip ___

Re: [osg-users] cross axes

2011-08-01 Thread ramy panda
Dear Sir, I still don't know how to settle the scale problem. Would you please help me with that. Thank you very much. Jonathan Richard wrote: Hi Gianni Thank you for your reply. It's ok I finally got it working. Jonathan On Wed, Aug 11, 2010 at 9:34 AM, Gianni Ambrosio wrote:

Re: [osg-users] cross axes

2010-08-22 Thread Jonathan Richard
Hi Gianni Thank you for your reply. It's ok I finally got it working. Jonathan On Wed, Aug 11, 2010 at 9:34 AM, Gianni Ambrosio ga...@vi-grade.com wrote: Sorry Jonathan for the delay. Unfortunately I don't remember exactly which modifications I did but if you need I can give you my actual

Re: [osg-users] cross axes

2010-08-11 Thread Gianni Ambrosio
Anyway, here is basically the code I used to update the axis: double offset = 80.0; crosscamera-setProjectionMatrix(osg::Matrix::ortho2D(-offset, iWidth-offset, -offset, iHeight-offset)); where offset is hardcoded here and it depends on the length of the axis. iWidth and iHeight are the width

Re: [osg-users] cross axes

2010-08-04 Thread Jonathan Richard
Hi Gianni, I'm trying to get working your example with the modification suggested by David but the axis appears to be drawn outside of my window. If I disable Can you tell me what modification did you perform on your NodeCallback implementation to get it working? Thanks Jonathan On 7/1/10,

Re: [osg-users] cross axes

2010-07-01 Thread Gianni Ambrosio
Thanks Nick, I implement it but some modifications caused another problem I don't understand. In the old code I created a cross axes with size=1.5 for each axis. The ortho camera was defined as follows: camera-setProjectionMatrix(osg::Matrix::ortho2D(-1.7, 17.75, -1.7, 13.86)); Then I had to

Re: [osg-users] cross axes

2010-07-01 Thread Trajce (Nick) Nikolov
could you post a working code of it? I will have a look at -Nick On Thu, Jul 1, 2010 at 1:35 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Thanks Nick, I implement it but some modifications caused another problem I don't understand. In the old code I created a cross axes with size=1.5 for

Re: [osg-users] cross axes

2010-07-01 Thread Gianni Ambrosio
Nick, here is a working code showing the label disappearing problem: Code: #include osgViewer/Viewer #include osgText/Text #include osg/LineWidth #include osg/Geometry #include osgGA/TrackballManipulator osgText::Text* createAxisLabel(const std::string iLabel, const osg::Vec3 iPosition) {

Re: [osg-users] cross axes

2010-07-01 Thread Trajce (Nick) Nikolov
cool. I ll have a look later today and get back to you -Nick On Thu, Jul 1, 2010 at 2:51 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Nick, here is a working code showing the label disappearing problem: Code: #include osgViewer/Viewer #include osgText/Text #include osg/LineWidth

Re: [osg-users] cross axes

2010-07-01 Thread Davide Bacchet
(hudAxesTransform); root-addChild(camera); ciao, Davide -- Forwarded message -- From: Gianni Ambrosio ga...@vi-grade.com To: osg-users@lists.openscenegraph.org Date: Thu, 01 Jul 2010 09:35:29 + Subject: Re: [osg-users] cross axes Thanks Nick, I implement it but some

Re: [osg-users] cross axes

2010-07-01 Thread Gianni Ambrosio
Thanks Davide. I considered that but since I would prefer to fix the axes origin to (0,0,0), I tried setting big values for zNear/zFar parameters for camera as follows: setProjectionMatrixAsOrtho(-80, 1280-80, -80, 1024-80,-800, 800); but nothing changed. Gianni -- Read this

Re: [osg-users] cross axes

2010-07-01 Thread Trajce (Nick) Nikolov
Gianni, I would follow Davide's hints and see if it works -Nick On Thu, Jul 1, 2010 at 5:36 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Thanks Davide. I considered that but since I would prefer to fix the axes origin to (0,0,0), I tried setting big values for zNear/zFar parameters for

Re: [osg-users] cross axes

2010-07-01 Thread Gianni Ambrosio
OK, I used what Davide suggested + a modification of my NodeCallback implementation and now it works fine. Thanks Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29612#29612 ___ osg-users

Re: [osg-users] cross axes

2010-06-30 Thread Gianni Ambrosio
Hi Nick, I'm using Qt and reimplemented the virtual method: virtual void resizeGL( int width, int height ) that is called on every window resize. I get the ortho camera and called getProjectionMatrixAsOrtho(left, right, bottom, top, zNear, zFar); just to verify the values. Do you mean I should

Re: [osg-users] cross axes

2010-06-30 Thread Trajce (Nick) Nikolov
exactly. make your ortho with the new window size -Nick On Wed, Jun 30, 2010 at 7:21 PM, Gianni Ambrosio ga...@vi-grade.com wrote: Hi Nick, I'm using Qt and reimplemented the virtual method: virtual void resizeGL( int width, int height ) that is called on every window resize. I get the

Re: [osg-users] cross axes

2010-06-26 Thread Trajce (Nick) Nikolov
if you are doing it thru ortho camera, then you have to change the camera settings to fit your new window size on resize -Nick On Fri, Jun 25, 2010 at 11:50 AM, Gianni Ambrosio ga...@vi-grade.comwrote: Another question. Now the axes works fine in the left bottom corner but if I resize the

Re: [osg-users] cross axes

2010-06-25 Thread Gianni Ambrosio
Another question. Now the axes works fine in the left bottom corner but if I resize the viewer window (I use QT embedding the viewer inside) the cross axes object is deformed accordingly. How can I prevent that? I mean, I agree to resize the axes but in a homogeneous way for every axis.

Re: [osg-users] cross axes

2010-06-23 Thread Gianni Ambrosio
Thanks Paul, you are right! Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=29287#29287 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] cross axes

2010-06-23 Thread Gianni Ambrosio
Since I did't find a complete example for adding a cross axes in a view, here is the sample code I roughly implemented. I starded from what Jimmy suggested here http://forum.openscenegraph.org/viewtopic.php?t=2205highlight=axis. Code: ViewerQT* viewerWindow = new ViewerQT; osg::Group*

Re: [osg-users] cross axes

2010-06-23 Thread Gianni Ambrosio
I have one question about my posted code. I added viewerWindow-addSlave(camera, false); otherwise camera-getView() call in AxisCameraUpdateCallback::operator() fails. I didn't find any documentation about that and I tried just intuitively. Regards Gianni -- Read this topic

Re: [osg-users] cross axes

2010-06-23 Thread Gianni Ambrosio
One more question. Suppose I have two viewers and I would like to show the axes just in one of them. Since the camera with the axes model is in the scene, is there any flexible way to enable/disable the axes in one viewer? Regards Gianni -- Read this topic online here:

Re: [osg-users] cross axes

2010-06-23 Thread Jean-Sébastien Guay
Hello Gianni, One more question. Suppose I have two viewers and I would like to show the axes just in one of them. Since the camera with the axes model is in the scene, is there any flexible way to enable/disable the axes in one viewer? You could search the archives for hints of how to

Re: [osg-users] cross axes

2010-06-23 Thread Gianni Ambrosio
Hi Jean-Sebastien, Skylark wrote: So they're useful for some things but I wouldn't use them for this (personally). I agree, if I understood correctly it doesn't make much sense in my case. Thanks fot the other ways you suggested. Regards Gianni -- Read this topic

Re: [osg-users] cross axes

2010-06-22 Thread Gianni Ambrosio
Looking around I found a topic that could help but I will ask some help about that later. Now, can anybody explain me please why I don't see the axes object in the bottom left corner of the viewer using the following code? I can see the cessna plane only in the viewer. ViewerQT*

Re: [osg-users] cross axes

2010-06-22 Thread Paul Martz
Gianni Ambrosio wrote: Looking around I found a topic that could help but I will ask some help about that later. Now, can anybody explain me please why I don't see the axes object in the bottom left corner of the viewer using the following code? I can see the cessna plane only in the viewer.