[osg-users] Best usage of function: return ref_ptr or standard ptr?

2012-01-30 Thread Juan Herrera
Hi,

I have a function which I want to return a group, with two alternatives:


Code:

osg::ref_ptr osg::Group  returnGroup()
{
osg::ref_ptr  osg::Group  group = new osg::Group;
...
return group;
}





Code:

osg::Group * returnGroup()
{
osg::Group * group = new osg::Group;
...
return group;
}




Which usage is better if garbage collection is desired?

Thank you!

Cheers,
Juan

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





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


[osg-users] Array of geometries

2012-01-30 Thread Juan Herrera
Hi,

I need to create an array of geometries. I'm not sure whether to use:


Code:

osg::Geometry** tube;
ref_ptr  ref_ptr  Geometry   tube;
ref_ptr  Geometry  * tube;




I want then to allocate the tube Geometry array as something like:

Code:

tube = new Geometry[pointList-size() - 1];




Thank you!

Cheers,
Juan

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





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


[osg-users] OSG and OpenGL rendering does not coincide

2011-12-11 Thread Juan Herrera
Hi,

I'm reframing my AR question like this:

Given same projection matrices and model view matrices in OpenGL and OSG, my 
rendering results do not coincide exactly. The OSG ones are slightly displaced, 
but the on-screen rotation coincide. There is no skewness in either.

I think the OpenGL results are the correct ones.

Where are the places this error could be? My windows size coincide, so I think 
the viewport is fine. (640x480).

Thank you!

Cheers,
Juan

PS: Note to moderator: replies to my posts are not being approved. See 
http://forum.openscenegraph.org/viewtopic.php?t=9485 .

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





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


Re: [osg-users] Setting modelview matrix with viewer.getCamera()-setViewMatrix(modelViewMatrix) not working

2011-12-11 Thread Juan Herrera
Hi,

The problem seemed to be twofold:

* I was first using OSG 2.8.3, for which
viewer.getCamera()-setViewMatrix(modelViewMatrix)
required that modelViewMatrix were a cv::Matrixd. This is not the case with 
3.0.1, which works with cv::Matrix too.

* Like filip suggested, I used 
viewer.getCameraManipulator()-setByMatrix(modelViewMatrix)
in the callback. It worked. I still have some registration glitches in the 
modeview matrix compared to my desired result, but maybe my original modelview 
matrix is wrong.

* I tried Paul's solution with both getCamera()-setViewMatrix() and 
getCameraManipulator()-setByMatrix(), but I wasn't able to reproduce the 
desired result (that's the solution in the Quickstart guide anyway, so I guess 
I may be missing something).

Thank you!

Cheers,
Juan Herrera

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





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