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

2020-04-15 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.


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

2020-04-15 Thread OpenSceneGraph Users


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


Re: [osg-users] LineSegmentIntersector

2020-04-15 Thread OpenSceneGraph Users
In my case its Perspective.


I was able to work around the problem by using a PolyTope intersector with 
a 1x1 rectangle. That worked perfectly.

On Tuesday, April 14, 2020 at 11:56:24 PM UTC-7, OpenSceneGraph Users wrote:
>
> Hi Andrew,
>
> When you say you have a isometric view, to be clear, you mean you have an 
> orthographic projection of the scene?  The OSG itself support orthographic 
> projection via the osg::Camera's ProjectionMatrix, the intersection.  It 
> can only account for this if the IntersectionVisitor knows about it's 
> setting.  
>
> Have you tried the osgViewer::View(er)::computeIntersections(..) method?
>
> This method knows about the View's Camera so can account for it's 
> projection matrix.
>
> Robert.
>
> On Tue, 14 Apr 2020 at 23:35, OpenSceneGraph Users <
> osg-...@lists.openscenegraph.org > wrote:
>
>> Hi,
>> I am having a lot of problems with picking with LineSegmentIntersector in 
>> OSG 3.6.5.
>>
>> I have reduced the problem to a a simple cube, center 0.5,0.5,0.5 with a 
>> boundingSphere radius of 1.2142
>>
>> I create the intersection with ( x , y are screen coordinates)
>>
>> picker=new osgUtil::LineSegmentIntersector ( osgUtil::Intersector::WINDOW
>> , x, y );
>> osgUtil::IntersectionVisitor iv ( picker );
>> getCamera()->accept ( iv );
>>
>>
>>
>> When I am "close" to the model geometry in an isometric view ( the cube 
>> fills,say, 50% of the screen), this works perfectly. I get the exact 
>> intersections coordinates I expect.
>>
>> When I "pull the camera back" from the geometry and the object is much 
>> smaller on the screen, the intersections fail.
>>
>> After much debugging, the problem is that the intersector fails the test 
>> of the intersection of the line with the bounding sphere of my model 
>> geometry
>>
>> Specifically I send up in
>>
>> bool LineSegmentIntersector::intersects(const osg::BoundingSphere& bs)
>>
>>
>> The BoundingSphere is in "model space" , and correct, but the _start and 
>> _end points used in the calculation are incorrect to intersect the sphere 
>> in model space and so the intersection fails.
>>
>> _start {_v=0x01ba7308d300 {13.227287349450325, -2.9785854231569449, -
>> 5.5167534692525066} }
>> _end {_v=0x01ba7308d318 {11.072576448741074, -5.1332963238661939, -
>> 7.6714332827528793} }
>>
>> Any ideas what is going on. It seems although the vector of start and end 
>> is the correct vector ( or the "closer" picking would not work), something 
>> is wrong in the transformation into model space.
>>
>> Thx
>> Andrew
>>
>> -- 
>> 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/4fa21208-3ee7-45d7-a9cf-42a4b8a45d52%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/440a9e5d-63e3-40d0-abed-490ca18a311d%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Error about LODs for an 11 layer paged database

2020-04-15 Thread OpenSceneGraph Users
Apologies for the delay on this my build command is

set PATH=C:\VirtualPlanetBuilder\windows\vpbWinBuild;%PATH%
set VPB_MAXIMUM_NUM_OPEN_DATASET=512
mkdir Charts
vpbmaster --levels 0 1 -t "Reprojected_files/Chart1" --levels 2 2 -t 
"Reprojected_files/Chart2" --levels 3 3 -t "Reprojected_files/Chart3" 
--levels 4 4 -t "Reprojected_files/Chart4" --levels 5 5 -t 
"Reprojected_files/Chart5" --levels 6 8 -t "Reprojected_files/Chart6" 
--levels 9 12 -t "Reprojected_files/Chart7" --levels 13 15 -t 
"Reprojected_files/Chart8" --levels 16 99 -t "Reprojected_files/Chart9"  
--levels 17 99 -t "Reprojected_files/Chart10" --levels  18 99 -t 
"Reprojected_files/Chart11" -o "x/x.ive" -O "compressed" 
./Chart.log

I've had to remove some data due to restrictions per company policy.

For the first 5 layers of charts I'm fine but getting the last 6 is 
becoming difficult.

Christopher 


On Monday, April 13, 2020 at 7:01:57 PM UTC-5, Chris Hanson wrote:
>
> What is your VPB build command?
>
> On Mon, Apr 13, 2020 at 2:16 PM christopher kleber  > wrote:
>
>> Good Afternoon
>>
>> I'm trying to build an 11 layer LOD paged database of charts.  
>> Previously I've built 5 layer charts with no issue.  
>> But this one needs 11 and is not going well.
>>
>> *Platform Data*
>> VPB version 0.9.10 
>> Windows edition
>>
>> *The resolution of each chart in meters per pixel*
>> Chart 1: 600m
>> Chart 2: 250m
>> Chart 3: 150m
>> Chart 4: 60m
>> Chart 5: 30m
>> Chart 6: 12.564m
>> Chart 7: 6.273m
>> Chart 8: 2.934m
>> Chart 9: 2.386m
>> Chart 10: 1.754m
>> Chart 11: 1.483m
>>
>> When I run my build script i get this error in the log file
>>
>> Skipping source Reprojected_files/Chart 6/.tif as its min level 
>> excees destination max level.
>> Skipping source Reprojected_files/Chart 7/.tif as its min level 
>> excees destination max level.
>> Skipping source Reprojected_files/Chart 8/.tif as its min level 
>> excees destination max level.
>> Skipping source Reprojected_files/Chart 9/.tif as its min level 
>> excees destination max level.
>> Skipping source Reprojected_files/Chart 10/.tif as its min level 
>> excees destination max level.
>> Skipping source Reprojected_files/Chart 11/.tif as its min level 
>> excees destination max level.
>>
>> What is causing this error and does anyone know how to mitigate it.
>>
>> Any help is appreciated.
>>
>> Christopher
>>
>> -- 
>> 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/de3fdbb3-8522-4df5-b93c-0434ec72e3c4%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
> http://www.alphapixel.com/
> Training • Consulting • Contracting
> 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 
> • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
> Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • 
> osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • 
> iPhone/iPad/iOS • Android
> @alphapixel  facebook.com/alphapixel (775) 
> 623-PIXL [7495]
>

-- 
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/9a3d8328-260e-46ec-a334-2af75f31aa17%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Correct way to modify Image used in a Texture2D (and have the Texture2D re-upload)

2020-04-15 Thread OpenSceneGraph Users
Calling dirty() on the image should be sufficient as the Texture2D will
check the modifiedCount on each time the texture is applied.  It's how
we've implemented things like video textures and has been working for a
long time.  It "should" work.

Put a check point or debug notice into the Texture/Texture2D::apply() code
to see if it's being applied correctly.

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

> I'm trying to figure out the correct way to notify Texture2D that I've
> modified the raw bytes of its underlying Image (previous set via setImage)
>
> I'm modifying the image data using image->data(), and then calling
> image->dirty() once modifications are complete. I can see this changes the
> 'modificationCount' of base-class BufferData, and if I write the image out
> to disk, it contains the changes. So, the image is being modified correctly.
>
> However, the Texture2D doesn't seem to to schedule a glTexSubImage2D (or
> similar ) on the next draw. What I'd be expecting is that Texture2D sees
> that the image modification count has changed, and uploads the new data.
>
> I tried to find other similar places in the code - eg the VncPlugin just
> calls 'dirty' on its Image as far as I can see.
>
> What else can I check to debug this?
>
>
> --
> 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/7d933227-d014-4afd-a445-c7854d5cda26%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


[osg-users] Correct way to modify Image used in a Texture2D (and have the Texture2D re-upload)

2020-04-15 Thread OpenSceneGraph Users
I'm trying to figure out the correct way to notify Texture2D that I've 
modified the raw bytes of its underlying Image (previous set via setImage)

I'm modifying the image data using image->data(), and then calling 
image->dirty() once modifications are complete. I can see this changes the 
'modificationCount' of base-class BufferData, and if I write the image out 
to disk, it contains the changes. So, the image is being modified correctly.

However, the Texture2D doesn't seem to to schedule a glTexSubImage2D (or 
similar ) on the next draw. What I'd be expecting is that Texture2D sees 
that the image modification count has changed, and uploads the new data.

I tried to find other similar places in the code - eg the VncPlugin just 
calls 'dirty' on its Image as far as I can see. 

What else can I check to debug this?


-- 
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/7d933227-d014-4afd-a445-c7854d5cda26%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org