Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-18 Thread OpenSceneGraph Users
Ok, I misinterpreted your previous post. AFAIR you can set a pivot-point for 
the PAT. (at least for the osgSim::DoFTransfrom).

If I’m mistaken, you need to put a transform in your change yourself. 

 

hth

Sebastian 

 

From: osg-users  On Behalf Of 
OpenSceneGraph Users
Sent: Samstag, 18. April 2020 17:06
To: OpenSceneGraph Users 
Subject: Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform 
"node" rotation

 

Sebastian

 

I'll experiment with removing the original group.

 

The original model structure doesn't include any transforms. So the structure I 
am looking at right now is:

 

Group "Heli" -> MyNewPAT -> Group "Main_Hub" -> Geometry1 ... GeometryN

 

If the MyNewPAT either child or parent was an object that contain the 
appropriate information such as pivot I could definitely extract that info and 
apply it to the PAT, but unfortunately it's surrounded by Groups.

 

Maybe I could create both a transform and a PAT, but I would still need some of 
that basic information to set its reference points.

 

I've attached an osgt example.

 

Thanks

Jeremy

On Saturday, April 18, 2020 at 6:53:10 AM UTC-4, OpenSceneGraph Users wrote:

Hi, 

 

you’re on the right track. Issue 1 stems from the fact, that you are not 
removing the original group or at least the childs you’re re-parenting (which 
still has references to your nodes).

Concerning issue 2. If the parent is a transform, you obviously need to take 
this into account. PAT has a setPivotPoint IIRC, but another option is to 
structure your scenegraph as follows:

 

Group -> OrginalTransform/Parent -> YourNewPAT -> Geometry1 … GeometryN

 

So leave the transform an put your PAT inbetween. That should solve the offset. 
If you’re still struggling with this, maybe supply a minimal osgt.

 

Cheers 
Sebastian 

 

From: osg-users  > On Behalf 
Of OpenSceneGraph Users
Sent: Samstag, 18. April 2020 01:38
To: OpenSceneGraph Users  >
Subject: Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform 
"node" rotation

 

Sebastian

 

Thank you for your patience and guidance. Programmatically definitely makes 
sense and I did look into that a short while back. I was initially looking at 
PositionAttitudeTransform. Now revisiting that approach, I understand why I 
started to look in another direction. Here is the dilemma I've come across. All 
is good until I try to assign a parent to the Transform 

 

hive::display::FindNamedNodeVisitor fnnv("Main_Hub");

scene->accept(fnnv);

osg::ref_ptr  autoTrans = new osg:: 
PositionAttitudeTransform();

 

//puts node and all children under transform

autoTrans->addChild(fnnv.getFoundNode());

 

//set the parent (this doesn’t seem completely right to me, but may be)

fnnv.getFoundNode()->getParent(0)->addChild(autoTrans);

 

issue 1) at this point it appears to create a duplicate object (node and 
children) of the “Main_Hub” group; 

issue 2) when I attempt rotation of the object it seems to be around the origin 
of the model instead of the previous “pivot pilot”

 

I seem to be missing how to squeeze that transform between the parent and child 
appropriately.

 

Jeremy


On Thursday, April 16, 2020 at 9:41:55 AM UTC-4, OpenSceneGraph Users wrote:

Hi Jeremy, 

 

Yes programmatically. You simply create a  Transform, DOFTransform, whatever 
and set all the children of the original Group as childs of the new one 
(transforms, as you surely know are groups too).

Lastly you want to want to set the parent as well. I haven’t used OSG in a 
while, but this pattern for sure works. 

If you have more questions fell free to ask.

 

Cheers 

Sebastian 

 

From: osg-users mailto:osg-user...@lists.openscenegraph.org> > On Behalf Of OpenSceneGraph 
Users
Sent: Donnerstag, 16. April 2020 14:36
To: OpenSceneGraph Users mailto:osg-...@googlegroups.com> >
Subject: Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform 
"node" rotation

 

Sebastian, I've used the nodevisitor to find the node by name, the node just 
happens to be a osg::group. Could you explain what you mean by "replace them 
with a DOF-Transform"? I'm optimistic that you mean programmatically. My 
current approach is to replace it manually in the osgt file.

 

Thanks

Jeremy

On Thursday, April 16, 2020 at 7:14:18 AM UTC-4, OpenSceneGraph Users wrote:

Hi Jeremy, 

 

As your geometry-parts are usually under a transform /group you can use a 
NodeVisitor to collect those (Find the nodes by name) and replace them with a 
DOF-Transform. 

You could of course also mess with the osgt-files, but that would be a last 
resort. 

 

Cheers

Sebastian 

 

From: osg-users mailto:osg-user...@lists.openscenegraph.org> > On Behalf Of OpenSceneGraph 
Users
Sent: Mittwoch, 15. April 2020 21:54
To: OpenSceneGraph Users mailto:osg-...@googlegroups.com> >
Subject: [osg-users] Edit 3D (osgt) mode

Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-18 Thread OpenSceneGraph Users
Hi, 

 

you’re on the right track. Issue 1 stems from the fact, that you are not 
removing the original group or at least the childs you’re re-parenting (which 
still has references to your nodes).

Concerning issue 2. If the parent is a transform, you obviously need to take 
this into account. PAT has a setPivotPoint IIRC, but another option is to 
structure your scenegraph as follows:

 

Group -> OrginalTransform/Parent -> YourNewPAT -> Geometry1 … GeometryN

 

So leave the transform an put your PAT inbetween. That should solve the offset. 
If you’re still struggeling with this, maybe supply a minimal osgt.

 

Cheers 
Sebastian 

 

From: osg-users  On Behalf Of 
OpenSceneGraph Users
Sent: Samstag, 18. April 2020 01:38
To: OpenSceneGraph Users 
Subject: Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform 
"node" rotation

 

Sebastian

 

Thank you for your patience and guidance. Programmatically definitely makes 
sense and I did look into that a short while back. I was initially looking at 
PositionAttitudeTransform. Now revisiting that approach, I understand why I 
started to look in another direction. Here is the dilemma I've come across. All 
is good until I try to assign a parent to the Transform 

 

hive::display::FindNamedNodeVisitor fnnv("Main_Hub");

scene->accept(fnnv);

osg::ref_ptr  autoTrans = new osg:: 
PositionAttitudeTransform();

 

//puts node and all children under transform

autoTrans->addChild(fnnv.getFoundNode());

 

//set the parent (this doesn’t seem completely right to me, but may be)

fnnv.getFoundNode()->getParent(0)->addChild(autoTrans);

 

issue 1) at this point it appears to create a duplicate object (node and 
children) of the “Main_Hub” group; 

issue 2) when I attempt rotation of the object it seems to be around the origin 
of the model instead of the previous “pivot pilot”

 

I seem to be missing how to squeeze that transform between the parent and child 
appropriately.

 

Jeremy


On Thursday, April 16, 2020 at 9:41:55 AM UTC-4, OpenSceneGraph Users wrote:

Hi Jeremy, 

 

Yes programmatically. You simply create a  Transform, DOFTransform, whatever 
and set all the children of the original Group as childs of the new one 
(transforms, as you surely know are groups too).

Lastly you want to want to set the parent as well. I haven’t used OSG in a 
while, but this pattern for sure works. 

If you have more questions fell free to ask.

 

Cheers 

Sebastian 

 

From: osg-users  > On Behalf 
Of OpenSceneGraph Users
Sent: Donnerstag, 16. April 2020 14:36
To: OpenSceneGraph Users  >
Subject: Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform 
"node" rotation

 

Sebastian, I've used the nodevisitor to find the node by name, the node just 
happens to be a osg::group. Could you explain what you mean by "replace them 
with a DOF-Transform"? I'm optimistic that you mean programmatically. My 
current approach is to replace it manually in the osgt file.

 

Thanks

Jeremy

On Thursday, April 16, 2020 at 7:14:18 AM UTC-4, OpenSceneGraph Users wrote:

Hi Jeremy, 

 

As your geometry-parts are usually under a transform /group you can use a 
NodeVisitor to collect those (Find the nodes by name) and replace them with a 
DOF-Transform. 

You could of course also mess with the osgt-files, but that would be a last 
resort. 

 

Cheers

Sebastian 

 

From: osg-users mailto:osg-user...@lists.openscenegraph.org> > On Behalf Of OpenSceneGraph 
Users
Sent: Mittwoch, 15. April 2020 21:54
To: OpenSceneGraph Users mailto:osg-...@googlegroups.com> >
Subject: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform 
"node" rotation

 

First off, I hope everyone is staying sane and healthy during this pandemic.

 

I’m working with a collection of 3D models that have come from a variety of 
different source but are now all in osgb format. For several of the models I’d 
like to grab a “node” and apply rotation.

 

As I’m working through my understanding of the approach, I’ve created a simple 
application that loads the model, traverses the scene, returns a pointer to the 
“node”, casts to a DOFTransform and manipulate the “node” (DOFTransform). 
Snippet:

FindNamedNodeVisitor fnnv("turret");

scene->accept(fnnv);

osg::ref_ptr dofTrans = new osgSim::DOFTransform();

dofTrans = 
dynamic_cast(fnnv.getFoundNode()->asTransform());

if(dofTrans != NULL)

//manipulate (rotate)   

 

This approach works for the tank.osg model. Now I’m trying to apply this 
approach to a different model (helicopter for example). When I access the 
“node” of interest, “Main_Hub” which is an osg::Group I obviously can’t cast 
that to a osgSim::DOFTransform. I’m trying to get an understand of how I can 
change the model, now in osgt (readable) format, to a structure that can be 
used. I’ve been using the tank.osg as a guide and attempt

Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-17 Thread OpenSceneGraph Users


Sebastian


Thank you for your patience and guidance. Programmatically definitely makes 
sense and I did look into that a short while back. I was initially looking 
at PositionAttitudeTransform. Now revisiting that approach, I understand 
why I started to look in another direction. Here is the dilemma I've come 
across. All is good until I try to assign a parent to the Transform 


hive::display::FindNamedNodeVisitor fnnv("Main_Hub");

scene->accept(fnnv);

osg::ref_ptr  autoTrans = new osg:: 
PositionAttitudeTransform();


//puts node and all children under transform

autoTrans->addChild(fnnv.getFoundNode());


//set the parent (this doesn’t seem completely right to me, but may be)

fnnv.getFoundNode()->getParent(0)->addChild(autoTrans);


issue 1) at this point it appears to create a duplicate object (node and 
children) of the “Main_Hub” group; 

issue 2) when I attempt rotation of the object it seems to be around the 
origin of the model instead of the previous “pivot pilot”


I seem to be missing how to squeeze that transform between the parent and 
child appropriately.


Jeremy

On Thursday, April 16, 2020 at 9:41:55 AM UTC-4, OpenSceneGraph Users wrote:
>
> Hi Jeremy, 
>
>  
>
> Yes programmatically. You simply create a  Transform, DOFTransform, 
> whatever and set all the children of the original Group as childs of the 
> new one (transforms, as you surely know are groups too).
>
> Lastly you want to want to set the parent as well. I haven’t used OSG in a 
> while, but this pattern for sure works. 
>
> If you have more questions fell free to ask.
>
>  
>
> Cheers 
>
> Sebastian 
>
>  
>
> *From:* osg-users > *On 
> Behalf Of *OpenSceneGraph Users
> *Sent:* Donnerstag, 16. April 2020 14:36
> *To:* OpenSceneGraph Users >
> *Subject:* Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and 
> perform "node" rotation
>
>  
>
> Sebastian, I've used the nodevisitor to find the node by name, the node 
> just happens to be a osg::group. Could you explain what you mean by 
> "replace them with a DOF-Transform"? I'm optimistic that you mean 
> programmatically. My current approach is to replace it manually in the osgt 
> file.
>
>  
>
> Thanks
>
> Jeremy
>
> On Thursday, April 16, 2020 at 7:14:18 AM UTC-4, OpenSceneGraph Users 
> wrote:
>
> Hi Jeremy, 
>
>  
>
> As your geometry-parts are usually under a transform /group you can use a 
> NodeVisitor to collect those (Find the nodes by name) and replace them with 
> a DOF-Transform. 
>
> You could of course also mess with the osgt-files, but that would be a 
> last resort. 
>
>  
>
> Cheers
>
> Sebastian 
>
>  
>
> *From:* osg-users  *On Behalf Of 
> *OpenSceneGraph 
> Users
> *Sent:* Mittwoch, 15. April 2020 21:54
> *To:* OpenSceneGraph Users 
> *Subject:* [osg-users] Edit 3D (osgt) model to add DOFTransform and 
> perform "node" rotation
>
>  
>
> First off, I hope everyone is staying sane and healthy during this 
> pandemic.
>
>  
>
> I’m working with a collection of 3D models that have come from a variety 
> of different source but are now all in osgb format. For several of the 
> models I’d like to grab a “node” and apply rotation.
>
>  
>
> As I’m working through my understanding of the approach, I’ve created a 
> simple application that loads the model, traverses the scene, returns a 
> pointer to the “node”, casts to a DOFTransform and manipulate the “node” 
> (DOFTransform). Snippet:
>
> FindNamedNodeVisitor fnnv("turret");
>
> scene->accept(fnnv);
>
> osg::ref_ptr dofTrans = new osgSim::DOFTransform();
>
> dofTrans = 
> dynamic_cast(fnnv.getFoundNode()->asTransform());
>
> if(dofTrans != NULL)
>
> //manipulate (rotate)   
>
>  
>
> This approach works for the tank.osg model. Now I’m trying to apply this 
> approach to a different model (helicopter for example). When I access the 
> “node” of interest, “Main_Hub” which is an osg::Group I obviously can’t 
> cast that to a osgSim::DOFTransform. I’m trying to get an understand of how 
> I can change the model, now in osgt (readable) format, to a structure that 
> can be used. I’ve been using the tank.osg as a guide and attempted to 
> recreate a similar structure in the helicopter.osgt. I’m trying to take 
> logical stabs in the dark, in the helicopter model I’ve attempted to simply 
> renamed the “node” of interest from an osg::Group to osgSim::DOFTransform. 
> The model still displays correctly, but the cast to osgSim::DOFTransform 
> returns NULL. I thought there may be some required variables at are needed 
> as part of the osgSim::DOFTrans

Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-16 Thread OpenSceneGraph Users
Hi Jeremy, 

 

Yes programmatically. You simply create a  Transform, DOFTransform, whatever 
and set all the children of the original Group as childs of the new one 
(transforms, as you surely know are groups too).

Lastly you want to want to set the parent as well. I haven’t used OSG in a 
while, but this pattern for sure works. 

If you have more questions fell free to ask.

 

Cheers 

Sebastian 

 

From: osg-users  On Behalf Of 
OpenSceneGraph Users
Sent: Donnerstag, 16. April 2020 14:36
To: OpenSceneGraph Users 
Subject: Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform 
"node" rotation

 

Sebastian, I've used the nodevisitor to find the node by name, the node just 
happens to be a osg::group. Could you explain what you mean by "replace them 
with a DOF-Transform"? I'm optimistic that you mean programmatically. My 
current approach is to replace it manually in the osgt file.

 

Thanks

Jeremy

On Thursday, April 16, 2020 at 7:14:18 AM UTC-4, OpenSceneGraph Users wrote:

Hi Jeremy, 

 

As your geometry-parts are usually under a transform /group you can use a 
NodeVisitor to collect those (Find the nodes by name) and replace them with a 
DOF-Transform. 

You could of course also mess with the osgt-files, but that would be a last 
resort. 

 

Cheers

Sebastian 

 

From: osg-users  > On Behalf 
Of OpenSceneGraph Users
Sent: Mittwoch, 15. April 2020 21:54
To: OpenSceneGraph Users  >
Subject: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform 
"node" rotation

 

First off, I hope everyone is staying sane and healthy during this pandemic.

 

I’m working with a collection of 3D models that have come from a variety of 
different source but are now all in osgb format. For several of the models I’d 
like to grab a “node” and apply rotation.

 

As I’m working through my understanding of the approach, I’ve created a simple 
application that loads the model, traverses the scene, returns a pointer to the 
“node”, casts to a DOFTransform and manipulate the “node” (DOFTransform). 
Snippet:

FindNamedNodeVisitor fnnv("turret");

scene->accept(fnnv);

osg::ref_ptr dofTrans = new osgSim::DOFTransform();

dofTrans = 
dynamic_cast(fnnv.getFoundNode()->asTransform());

if(dofTrans != NULL)

//manipulate (rotate)   

 

This approach works for the tank.osg model. Now I’m trying to apply this 
approach to a different model (helicopter for example). When I access the 
“node” of interest, “Main_Hub” which is an osg::Group I obviously can’t cast 
that to a osgSim::DOFTransform. I’m trying to get an understand of how I can 
change the model, now in osgt (readable) format, to a structure that can be 
used. I’ve been using the tank.osg as a guide and attempted to recreate a 
similar structure in the helicopter.osgt. I’m trying to take logical stabs in 
the dark, in the helicopter model I’ve attempted to simply renamed the “node” 
of interest from an osg::Group to osgSim::DOFTransform. The model still 
displays correctly, but the cast to osgSim::DOFTransform returns NULL. I 
thought there may be some required variables at are needed as part of the 
osgSim::DOFTransform structure, so I began adding currentHPR, currentTranslate, 
and currentScale and continued to add more bringing it in line with the 
tank.osg example. Through all the attempts I still getting NULL when casting.

 

I’m looking for any guidance/suggestions/lessons learned on how to properly do 
this.

 

Thanks in advance

 

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to   osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit  
<https://groups.google.com/d/msgid/osg-users/cbb4b132-24a7-4e75-b10f-7474c1a99378%40googlegroups.com?utm_medium=email_source=footer>
 
https://groups.google.com/d/msgid/osg-users/cbb4b132-24a7-4e75-b10f-7474c1a99378%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com 
<mailto:osg-users+unsubscr...@googlegroups.com> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/5fcaac09-655d-44f9-bf97-47eee2a19b97%40googlegroups.com
 
<https://groups.google.com/d/msgid/osg-users/5fcaac09-655d-44f9-bf97-47eee2a19b97%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/m

Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-16 Thread OpenSceneGraph Users
Sebastian, I've used the nodevisitor to find the node by name, the node 
just happens to be a osg::group. Could you explain what you mean by 
"replace them with a DOF-Transform"? I'm optimistic that you mean 
programmatically. My current approach is to replace it manually in the osgt 
file.

Thanks
Jeremy

On Thursday, April 16, 2020 at 7:14:18 AM UTC-4, OpenSceneGraph Users wrote:
>
> Hi Jeremy, 
>
>  
>
> As your geometry-parts are usually under a transform /group you can use a 
> NodeVisitor to collect those (Find the nodes by name) and replace them with 
> a DOF-Transform. 
>
> You could of course also mess with the osgt-files, but that would be a 
> last resort. 
>
>  
>
> Cheers
>
> Sebastian 
>
>  
>
> *From:* osg-users > *On 
> Behalf Of *OpenSceneGraph Users
> *Sent:* Mittwoch, 15. April 2020 21:54
> *To:* OpenSceneGraph Users >
> *Subject:* [osg-users] Edit 3D (osgt) model to add DOFTransform and 
> perform "node" rotation
>
>  
>
> First off, I hope everyone is staying sane and healthy during this 
> pandemic.
>
>  
>
> I’m working with a collection of 3D models that have come from a variety 
> of different source but are now all in osgb format. For several of the 
> models I’d like to grab a “node” and apply rotation.
>
>  
>
> As I’m working through my understanding of the approach, I’ve created a 
> simple application that loads the model, traverses the scene, returns a 
> pointer to the “node”, casts to a DOFTransform and manipulate the “node” 
> (DOFTransform). Snippet:
>
> FindNamedNodeVisitor fnnv("turret");
>
> scene->accept(fnnv);
>
> osg::ref_ptr dofTrans = new osgSim::DOFTransform();
>
> dofTrans = 
> dynamic_cast(fnnv.getFoundNode()->asTransform());
>
> if(dofTrans != NULL)
>
> //manipulate (rotate)   
>
>  
>
> This approach works for the tank.osg model. Now I’m trying to apply this 
> approach to a different model (helicopter for example). When I access the 
> “node” of interest, “Main_Hub” which is an osg::Group I obviously can’t 
> cast that to a osgSim::DOFTransform. I’m trying to get an understand of how 
> I can change the model, now in osgt (readable) format, to a structure that 
> can be used. I’ve been using the tank.osg as a guide and attempted to 
> recreate a similar structure in the helicopter.osgt. I’m trying to take 
> logical stabs in the dark, in the helicopter model I’ve attempted to simply 
> renamed the “node” of interest from an osg::Group to osgSim::DOFTransform. 
> The model still displays correctly, but the cast to osgSim::DOFTransform 
> returns NULL. I thought there may be some required variables at are needed 
> as part of the osgSim::DOFTransform structure, so I began adding 
> currentHPR, currentTranslate, and currentScale and continued to add more 
> bringing it in line with the tank.osg example. Through all the attempts I 
> still getting NULL when casting.
>
>  
>
> I’m looking for any guidance/suggestions/lessons learned on how to 
> properly do this.
>
>  
>
> Thanks in advance
>
>  
>
> Jeremy
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to osg-users+unsubscr...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/osg-users/cbb4b132-24a7-4e75-b10f-7474c1a99378%40googlegroups.com
>  
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/5fcaac09-655d-44f9-bf97-47eee2a19b97%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-16 Thread OpenSceneGraph Users
Laurens, I focused on the osgSIM::DOFTransform since it was the example in 
the tank.osg file, but I will look into the other transform options. Thank 
you.

On Thursday, April 16, 2020 at 4:55:21 AM UTC-4, Voerman, L. wrote:
>
> Hi Jeremy,
> editing your helicopter.osgt should work, and while I never work with 
> osgSim::DOFTransform 
> (I alway use osg::MatixTransform) both descend from osg::Group, and can be 
> used in osg text files to replace a group.
> However, the optimizer might find a transform with an identity matrix, and 
> optimize it to a Group again.
> To test your edits, use these commands:
>   set OSG_OPTIMIZER=OFF
>   osgconv helicopter.osgt rw_test.osgt
>   winmerge helicopter.osgt rw_test.osgt 
> You should find all default values filled in the  rw_test.osgt. 
>
> Laurens.
>
>
> On Wed, Apr 15, 2020 at 10:17 PM OpenSceneGraph Users <
> osg-...@lists.openscenegraph.org > wrote:
>
>> First off, I hope everyone is staying sane and healthy during this 
>> pandemic.
>>
>>  
>>
>> I’m working with a collection of 3D models that have come from a variety 
>> of different source but are now all in osgb format. For several of the 
>> models I’d like to grab a “node” and apply rotation.
>>
>>  
>>
>> As I’m working through my understanding of the approach, I’ve created a 
>> simple application that loads the model, traverses the scene, returns a 
>> pointer to the “node”, casts to a DOFTransform and manipulate the “node” 
>> (DOFTransform). Snippet:
>>
>> FindNamedNodeVisitor fnnv("turret");
>>
>> scene->accept(fnnv);
>>
>> osg::ref_ptr dofTrans = new osgSim::DOFTransform();
>>
>> dofTrans = 
>> dynamic_cast(fnnv.getFoundNode()->asTransform());
>>
>> if(dofTrans != NULL)
>>
>> //manipulate (rotate)   
>>
>>  
>>
>> This approach works for the tank.osg model. Now I’m trying to apply this 
>> approach to a different model (helicopter for example). When I access the 
>> “node” of interest, “Main_Hub” which is an osg::Group I obviously can’t 
>> cast that to a osgSim::DOFTransform. I’m trying to get an understand of how 
>> I can change the model, now in osgt (readable) format, to a structure that 
>> can be used. I’ve been using the tank.osg as a guide and attempted to 
>> recreate a similar structure in the helicopter.osgt. I’m trying to take 
>> logical stabs in the dark, in the helicopter model I’ve attempted to simply 
>> renamed the “node” of interest from an osg::Group to osgSim::DOFTransform. 
>> The model still displays correctly, but the cast to osgSim::DOFTransform 
>> returns NULL. I thought there may be some required variables at are needed 
>> as part of the osgSim::DOFTransform structure, so I began adding 
>> currentHPR, currentTranslate, and currentScale and continued to add more 
>> bringing it in line with the tank.osg example. Through all the attempts I 
>> still getting NULL when casting.
>>
>>  
>>
>> I’m looking for any guidance/suggestions/lessons learned on how to 
>> properly do this.
>>
>>
>> Thanks in advance
>>
>>  
>>
>> Jeremy
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "OpenSceneGraph Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to osg-...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/osg-users/cbb4b132-24a7-4e75-b10f-7474c1a99378%40googlegroups.com
>>  
>> 
>> .
>> ___
>> osg-users mailing list
>> osg-...@lists.openscenegraph.org 
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/5a0339a8-e447-4a4f-9a0c-a1914b201885%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-16 Thread OpenSceneGraph Users
Thanks Robert, I thought the structure may be a bit much but here is the 
high level breakdown:
osg::MatrixTransform
-osg::Group
--osg::StateSet
-osg::Group
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Group
--osg::Geode
--osg::Group
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Group
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Group
--osg::Group
--osg::Group
--osg::Group
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Geode
--osg::Group
---osg::Group "Main_Hub"
osg::Geode
-osg::Geometry
--osg::StateSet
---osg::DrawArray
osg::Vec3Array
--osg::Group "Tail_Hub"

Again I'm looking to access the osg::Group "Main_Hub" get Transform 
functionality from it.

Jeremy


On Thursday, April 16, 2020 at 2:39:10 AM UTC-4, OpenSceneGraph Users wrote:
>
> Hi Jeremy,
>
> The DOFTransform example you've come across only works for a 
> osgSIM::DOFTransform because it was created with this type of 
> DOFTransform.  THE DOFTransform is written specifically for OpenFlight 
> support so only created by the the OSG .flt loader, most other models will 
> use other types of osg::Transform nodes such as osg::MatrixTransform or 
> osg::PositionAttitutudeTransform.  
>
> You haven't provide any details about the scene graphs structure of your 
> helicopter.osgt so we can't tell what to look for, the model might not even 
> have any Transform node in it, in which case you'll need to add one.
>
> Robert.
>
>
>
> On Wed, 15 Apr 2020 at 21:55, OpenSceneGraph Users <
> osg-...@lists.openscenegraph.org > wrote:
>
>> First off, I hope everyone is staying sane and healthy during this 
>> pandemic.
>>
>>  
>>
>> I’m working with a collection of 3D models that have come from a variety 
>> of different source but are now all in osgb format. For several of the 
>> models I’d like to grab a “node” and apply rotation.
>>
>>  
>>
>> As I’m working through my understanding of the approach, I’ve created a 
>> simple application that loads the model, traverses the scene, returns a 
>> pointer to the “node”, casts to a DOFTransform and manipulate the “node” 
>> (DOFTransform). Snippet:
>>
>> FindNamedNodeVisitor fnnv("turret");
>>
>> scene->accept(fnnv);
>>
>> osg::ref_ptr dofTrans = new osgSim::DOFTransform();
>>
>> dofTrans = 
>> dynamic_cast(fnnv.getFoundNode()->asTransform());
>>
>> if(dofTrans != NULL)
>>
>> //manipulate (rotate)   
>>
>>  
>>
>> This approach works for the tank.osg model. Now I’m trying to apply this 
>> approach to a different model (helicopter for example). When I access the 
>> “node” of interest, “Main_Hub” which is an osg::Group I obviously can’t 
>> cast that to a osgSim::DOFTransform. I’m trying to get an understand of how 
>> I can change the model, now in osgt (readable) format, to a structure that 
>> can be used. I’ve been using the tank.osg as a guide and attempted to 
>> recreate a similar structure in the helicopter.osgt. I’m trying to take 
>> logical stabs in the dark, in the helicopter model I’ve attempted to simply 
>> renamed the “node” of interest from an osg::Group to osgSim::DOFTransform. 
>> The model still displays correctly, but the cast to osgSim::DOFTransform 
>> returns NULL. I thought there may be some required variables at are needed 
>> as part of the osgSim::DOFTransform structure, so I began adding 
>> currentHPR, currentTranslate, and currentScale and continued to add more 
>> bringing it in line with the tank.osg example. Through all the attempts I 
>> still getting NULL when casting.
>>
>>  
>>
>> I’m looking for any guidance/suggestions/lessons learned on how to 
>> properly do this.
>>
>>
>> Thanks in advance
>>
>>  
>>
>> Jeremy
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "OpenSceneGraph Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to osg-...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/osg-users/cbb4b132-24a7-4e75-b10f-7474c1a99378%40googlegroups.com
>>  
>> 
>> .
>> ___
>> osg-users mailing list
>> osg-...@lists.openscenegraph.org 
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/ea7ac52d-bf9f-42bf-8b1c-a90bac81017b%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org

Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-16 Thread OpenSceneGraph Users
Hi Jeremy, 

 

As your geometry-parts are usually under a transform /group you can use a 
NodeVisitor to collect those (Find the nodes by name) and replace them with a 
DOF-Transform. 

You could of course also mess with the osgt-files, but that would be a last 
resort. 

 

Cheers

Sebastian 

 

From: osg-users  On Behalf Of 
OpenSceneGraph Users
Sent: Mittwoch, 15. April 2020 21:54
To: OpenSceneGraph Users 
Subject: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform 
"node" rotation

 

First off, I hope everyone is staying sane and healthy during this pandemic.

 

I’m working with a collection of 3D models that have come from a variety of 
different source but are now all in osgb format. For several of the models I’d 
like to grab a “node” and apply rotation.

 

As I’m working through my understanding of the approach, I’ve created a simple 
application that loads the model, traverses the scene, returns a pointer to the 
“node”, casts to a DOFTransform and manipulate the “node” (DOFTransform). 
Snippet:

FindNamedNodeVisitor fnnv("turret");

scene->accept(fnnv);

osg::ref_ptr dofTrans = new osgSim::DOFTransform();

dofTrans = 
dynamic_cast(fnnv.getFoundNode()->asTransform());

if(dofTrans != NULL)

//manipulate (rotate)   

 

This approach works for the tank.osg model. Now I’m trying to apply this 
approach to a different model (helicopter for example). When I access the 
“node” of interest, “Main_Hub” which is an osg::Group I obviously can’t cast 
that to a osgSim::DOFTransform. I’m trying to get an understand of how I can 
change the model, now in osgt (readable) format, to a structure that can be 
used. I’ve been using the tank.osg as a guide and attempted to recreate a 
similar structure in the helicopter.osgt. I’m trying to take logical stabs in 
the dark, in the helicopter model I’ve attempted to simply renamed the “node” 
of interest from an osg::Group to osgSim::DOFTransform. The model still 
displays correctly, but the cast to osgSim::DOFTransform returns NULL. I 
thought there may be some required variables at are needed as part of the 
osgSim::DOFTransform structure, so I began adding currentHPR, currentTranslate, 
and currentScale and continued to add more bringing it in line with the 
tank.osg example. Through all the attempts I still getting NULL when casting.

 

I’m looking for any guidance/suggestions/lessons learned on how to properly do 
this.

 

Thanks in advance

 

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to   
osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit  

 
https://groups.google.com/d/msgid/osg-users/cbb4b132-24a7-4e75-b10f-7474c1a99378%40googlegroups.com.



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-16 Thread OpenSceneGraph Users
Hi Jeremy,
editing your helicopter.osgt should work, and while I never work with
osgSim::DOFTransform
(I alway use osg::MatixTransform) both descend from osg::Group, and can be
used in osg text files to replace a group.
However, the optimizer might find a transform with an identity matrix, and
optimize it to a Group again.
To test your edits, use these commands:
  set OSG_OPTIMIZER=OFF
  osgconv helicopter.osgt rw_test.osgt
  winmerge helicopter.osgt rw_test.osgt
You should find all default values filled in the  rw_test.osgt.

Laurens.


On Wed, Apr 15, 2020 at 10:17 PM OpenSceneGraph Users <
osg-users@lists.openscenegraph.org> wrote:

> First off, I hope everyone is staying sane and healthy during this
> pandemic.
>
>
>
> I’m working with a collection of 3D models that have come from a variety
> of different source but are now all in osgb format. For several of the
> models I’d like to grab a “node” and apply rotation.
>
>
>
> As I’m working through my understanding of the approach, I’ve created a
> simple application that loads the model, traverses the scene, returns a
> pointer to the “node”, casts to a DOFTransform and manipulate the “node”
> (DOFTransform). Snippet:
>
> FindNamedNodeVisitor fnnv("turret");
>
> scene->accept(fnnv);
>
> osg::ref_ptr dofTrans = new osgSim::DOFTransform();
>
> dofTrans =
> dynamic_cast(fnnv.getFoundNode()->asTransform());
>
> if(dofTrans != NULL)
>
> //manipulate (rotate)
>
>
>
> This approach works for the tank.osg model. Now I’m trying to apply this
> approach to a different model (helicopter for example). When I access the
> “node” of interest, “Main_Hub” which is an osg::Group I obviously can’t
> cast that to a osgSim::DOFTransform. I’m trying to get an understand of how
> I can change the model, now in osgt (readable) format, to a structure that
> can be used. I’ve been using the tank.osg as a guide and attempted to
> recreate a similar structure in the helicopter.osgt. I’m trying to take
> logical stabs in the dark, in the helicopter model I’ve attempted to simply
> renamed the “node” of interest from an osg::Group to osgSim::DOFTransform.
> The model still displays correctly, but the cast to osgSim::DOFTransform
> returns NULL. I thought there may be some required variables at are needed
> as part of the osgSim::DOFTransform structure, so I began adding
> currentHPR, currentTranslate, and currentScale and continued to add more
> bringing it in line with the tank.osg example. Through all the attempts I
> still getting NULL when casting.
>
>
>
> I’m looking for any guidance/suggestions/lessons learned on how to
> properly do this.
>
>
> Thanks in advance
>
>
>
> Jeremy
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osg-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osg-users/cbb4b132-24a7-4e75-b10f-7474c1a99378%40googlegroups.com
> 
> .
> ___
> 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] Edit 3D (osgt) model to add DOFTransform and perform "node" rotation

2020-04-16 Thread OpenSceneGraph Users
Hi Jeremy,

The DOFTransform example you've come across only works for a
osgSIM::DOFTransform because it was created with this type of
DOFTransform.  THE DOFTransform is written specifically for OpenFlight
support so only created by the the OSG .flt loader, most other models will
use other types of osg::Transform nodes such as osg::MatrixTransform or
osg::PositionAttitutudeTransform.

You haven't provide any details about the scene graphs structure of your
helicopter.osgt so we can't tell what to look for, the model might not even
have any Transform node in it, in which case you'll need to add one.

Robert.



On Wed, 15 Apr 2020 at 21:55, OpenSceneGraph Users <
osg-users@lists.openscenegraph.org> wrote:

> First off, I hope everyone is staying sane and healthy during this
> pandemic.
>
>
>
> I’m working with a collection of 3D models that have come from a variety
> of different source but are now all in osgb format. For several of the
> models I’d like to grab a “node” and apply rotation.
>
>
>
> As I’m working through my understanding of the approach, I’ve created a
> simple application that loads the model, traverses the scene, returns a
> pointer to the “node”, casts to a DOFTransform and manipulate the “node”
> (DOFTransform). Snippet:
>
> FindNamedNodeVisitor fnnv("turret");
>
> scene->accept(fnnv);
>
> osg::ref_ptr dofTrans = new osgSim::DOFTransform();
>
> dofTrans =
> dynamic_cast(fnnv.getFoundNode()->asTransform());
>
> if(dofTrans != NULL)
>
> //manipulate (rotate)
>
>
>
> This approach works for the tank.osg model. Now I’m trying to apply this
> approach to a different model (helicopter for example). When I access the
> “node” of interest, “Main_Hub” which is an osg::Group I obviously can’t
> cast that to a osgSim::DOFTransform. I’m trying to get an understand of how
> I can change the model, now in osgt (readable) format, to a structure that
> can be used. I’ve been using the tank.osg as a guide and attempted to
> recreate a similar structure in the helicopter.osgt. I’m trying to take
> logical stabs in the dark, in the helicopter model I’ve attempted to simply
> renamed the “node” of interest from an osg::Group to osgSim::DOFTransform.
> The model still displays correctly, but the cast to osgSim::DOFTransform
> returns NULL. I thought there may be some required variables at are needed
> as part of the osgSim::DOFTransform structure, so I began adding
> currentHPR, currentTranslate, and currentScale and continued to add more
> bringing it in line with the tank.osg example. Through all the attempts I
> still getting NULL when casting.
>
>
>
> I’m looking for any guidance/suggestions/lessons learned on how to
> properly do this.
>
>
> Thanks in advance
>
>
>
> Jeremy
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osg-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osg-users/cbb4b132-24a7-4e75-b10f-7474c1a99378%40googlegroups.com
> 
> .
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/mailman.84133.1587019137.7168.osg-users-openscenegraph.org%40lists.openscenegraph.org.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/mailman.84133.1587019137.7168.osg-users-openscenegraph.org%40lists.openscenegraph.org.