Re: [osg-users] converting node coordinates

2017-06-23 Thread tianzjyh
Hi, Oliveira, 
I am not sure what exactly is causing the problem, but maybe it is the 
setVertexArray(). U should call VertexArray::dirty(),after you changed data in 
osg::Array at runtime, to tell the OSG to update corresponding data in the GPU 
memory.





--





Cheers, 
---
TianZJ

At 2017-06-23 01:12:47, "Bruno Oliveira"  
wrote:



However, when I do this, I can see my points, BUT when I try to manipulate my 
scene with the mouse, the data disappears if I zoom in, and appears again if I 
zoom out again.

This seems like my node's bounds are not well set, But I manually verified all 
node's bounds and they are correct


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


Re: [osg-users] converting node coordinates

2017-06-22 Thread Bruno Oliveira
Probably it does, however I tried deactivating Culling and my scene is not
rendered properly anymore (some LOD nodes are not rendered).

My bounding spheres are correctly calculated. Are they set with
node->setInitialBound(calculatedBound);   ?

2017-06-22 18:54 GMT+01:00 sam :

> When you zoom your mouse feel forward it's possible that the new sphere is
> outside the camera's view and thus being culled out of the drawing. Check
> to make sure the sphere doesn't end up behind the camera.
>
> On Thu, Jun 22, 2017 at 10:38 AM, Bruno Oliveira <
> bruno.manata.olive...@gmail.com> wrote:
>
>> I am almost sure I am making some mistake on setting the node's bounding
>> sphere. Is my code correct on that example I gave?
>>
>> 2017-06-22 18:29 GMT+01:00 Bruno Oliveira > om>:
>>
>>> Sorry I'm not sure what you're asking.
>>>
>>> I manipulate my scene with a Mouse Manipulator (Trackball), hence the
>>> view is refreshed and I can see my nodes, but if I zoom in they disappear
>>>
>>> 2017-06-22 18:23 GMT+01:00 Sam Brkopac :
>>>
 Hi Bruno,

 After you manipulate the coordinates do the new bounds result in the
 node getting culled by the camera?

 Thanks, Sam

 > On Jun 22, 2017, at 10:12, Bruno Oliveira <
 bruno.manata.olive...@gmail.com> wrote:
 >
 > Hello,
 >
 > I have some osg::Nodes with some initial geometry coordinates.
 >
 > Then, after some rendering, at some point I need to transform those
 initial coordinates. I do something like this:
 >
 >
 > void MyNodeGeometry::convertCoordinates() {
 >
 > auto* vert = this->getVertexArray();
 >
 > for (int i = 0; i < vert->size(); i++) {
 > convertCoordinate(vert->operator[](i));
 > }
 >
 > this->setVertexArray(vert);
 >
 > this->setInitialBound(this->computeBound());
 > this->firtyBound();
 >
 > }
 >
 >
 > Also, in all parent Nodes I call
 >
 > parentNode->setInitialBound(this->computeBound());
 > parent->firtyBound();
 >
 >
 >
 > However, when I do this, I can see my points, BUT when I try to
 manipulate my scene with the mouse, the data disappears if I zoom in, and
 appears again if I zoom out again.
 > This seems like my node's bounds are not well set, But I manually
 verified all node's bounds and they are correct
 >
 > Any idea?
 > ___
 > osg-users mailing list
 > osg-users@lists.openscenegraph.org
 > http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
 cenegraph.org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
 cenegraph.org

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


Re: [osg-users] converting node coordinates

2017-06-22 Thread sam
When you zoom your mouse feel forward it's possible that the new sphere is
outside the camera's view and thus being culled out of the drawing. Check
to make sure the sphere doesn't end up behind the camera.

On Thu, Jun 22, 2017 at 10:38 AM, Bruno Oliveira <
bruno.manata.olive...@gmail.com> wrote:

> I am almost sure I am making some mistake on setting the node's bounding
> sphere. Is my code correct on that example I gave?
>
> 2017-06-22 18:29 GMT+01:00 Bruno Oliveira  >:
>
>> Sorry I'm not sure what you're asking.
>>
>> I manipulate my scene with a Mouse Manipulator (Trackball), hence the
>> view is refreshed and I can see my nodes, but if I zoom in they disappear
>>
>> 2017-06-22 18:23 GMT+01:00 Sam Brkopac :
>>
>>> Hi Bruno,
>>>
>>> After you manipulate the coordinates do the new bounds result in the
>>> node getting culled by the camera?
>>>
>>> Thanks, Sam
>>>
>>> > On Jun 22, 2017, at 10:12, Bruno Oliveira <
>>> bruno.manata.olive...@gmail.com> wrote:
>>> >
>>> > Hello,
>>> >
>>> > I have some osg::Nodes with some initial geometry coordinates.
>>> >
>>> > Then, after some rendering, at some point I need to transform those
>>> initial coordinates. I do something like this:
>>> >
>>> >
>>> > void MyNodeGeometry::convertCoordinates() {
>>> >
>>> > auto* vert = this->getVertexArray();
>>> >
>>> > for (int i = 0; i < vert->size(); i++) {
>>> > convertCoordinate(vert->operator[](i));
>>> > }
>>> >
>>> > this->setVertexArray(vert);
>>> >
>>> > this->setInitialBound(this->computeBound());
>>> > this->firtyBound();
>>> >
>>> > }
>>> >
>>> >
>>> > Also, in all parent Nodes I call
>>> >
>>> > parentNode->setInitialBound(this->computeBound());
>>> > parent->firtyBound();
>>> >
>>> >
>>> >
>>> > However, when I do this, I can see my points, BUT when I try to
>>> manipulate my scene with the mouse, the data disappears if I zoom in, and
>>> appears again if I zoom out again.
>>> > This seems like my node's bounds are not well set, But I manually
>>> verified all node's bounds and they are correct
>>> >
>>> > Any idea?
>>> > ___
>>> > osg-users mailing list
>>> > osg-users@lists.openscenegraph.org
>>> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>>> cenegraph.org
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>>> cenegraph.org
>>>
>>
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] converting node coordinates

2017-06-22 Thread Bruno Oliveira
I am almost sure I am making some mistake on setting the node's bounding
sphere. Is my code correct on that example I gave?

2017-06-22 18:29 GMT+01:00 Bruno Oliveira :

> Sorry I'm not sure what you're asking.
>
> I manipulate my scene with a Mouse Manipulator (Trackball), hence the view
> is refreshed and I can see my nodes, but if I zoom in they disappear
>
> 2017-06-22 18:23 GMT+01:00 Sam Brkopac :
>
>> Hi Bruno,
>>
>> After you manipulate the coordinates do the new bounds result in the node
>> getting culled by the camera?
>>
>> Thanks, Sam
>>
>> > On Jun 22, 2017, at 10:12, Bruno Oliveira <
>> bruno.manata.olive...@gmail.com> wrote:
>> >
>> > Hello,
>> >
>> > I have some osg::Nodes with some initial geometry coordinates.
>> >
>> > Then, after some rendering, at some point I need to transform those
>> initial coordinates. I do something like this:
>> >
>> >
>> > void MyNodeGeometry::convertCoordinates() {
>> >
>> > auto* vert = this->getVertexArray();
>> >
>> > for (int i = 0; i < vert->size(); i++) {
>> > convertCoordinate(vert->operator[](i));
>> > }
>> >
>> > this->setVertexArray(vert);
>> >
>> > this->setInitialBound(this->computeBound());
>> > this->firtyBound();
>> >
>> > }
>> >
>> >
>> > Also, in all parent Nodes I call
>> >
>> > parentNode->setInitialBound(this->computeBound());
>> > parent->firtyBound();
>> >
>> >
>> >
>> > However, when I do this, I can see my points, BUT when I try to
>> manipulate my scene with the mouse, the data disappears if I zoom in, and
>> appears again if I zoom out again.
>> > This seems like my node's bounds are not well set, But I manually
>> verified all node's bounds and they are correct
>> >
>> > Any idea?
>> > ___
>> > osg-users mailing list
>> > osg-users@lists.openscenegraph.org
>> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>> cenegraph.org
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org