OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Scale Flattening and LODs


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Cary, Karl A.
Guest





PostPosted: Mon Apr 14, 2014 4:54 pm    Post subject:
Scale Flattening and LODs
Reply with quote

I have run across an issue related to scaled flattening over an LOD. I have a Matrix transform with a static scale in it over an LOD node. For the LOD, I have exact ranges that I want it to change at, regardless of scale, i.e. always switch LOD at 1000ft, 2000ft etc. If I leave the matrix transform in place then I have to divide the ranges by the scale value as they get that scalar applied to them as well apparently. This is what we have been using for quite some time and works fine. I am trying now to flatten the scale transform out. When I do it though, the ranges don’t get touched so I don’t need to adjust them, but for some reason the raidus is also being left alone and now suddenly there is a center value that did not exist prior. In order to see this, I am spitting out the scenegraph to a .osg file.

Is there something extra I need to do to an LOD to flatten the transform out? I am using the osg::Optimizer to do it.

------------------
Post generated by Mail2Forum
Back to top
Cary, Karl A.
Guest





PostPosted: Mon Apr 14, 2014 7:06 pm    Post subject:
Scale Flattening and LODs
Reply with quote

To at least partially answer my own question, everything seems fine if I manually apply the scale to the radius. So essentially, if you have a scale transform, it will affect the radius, center point, ranges, and vertex positions during the cull and draw. However if you flatten the scale, it seems to only affect the vertex positions and center. You have to manually adjust ranges and radius.

Is this not supposed to be true? Is there anything else that I need to be double checking on? This is with 3.0.1.

From: [mailto:] On Behalf Of Cary, Karl A.
Sent: Monday, April 14, 2014 12:51 PM
To: OpenSceneGraph Users
Subject: Scale Flattening and LODs



I have run across an issue related to scaled flattening over an LOD. I have a Matrix transform with a static scale in it over an LOD node. For the LOD, I have exact ranges that I want it to change at, regardless of scale, i.e. always switch LOD at 1000ft, 2000ft etc. If I leave the matrix transform in place then I have to divide the ranges by the scale value as they get that scalar applied to them as well apparently. This is what we have been using for quite some time and works fine. I am trying now to flatten the scale transform out. When I do it though, the ranges don’t get touched so I don’t need to adjust them, but for some reason the raidus is also being left alone and now suddenly there is a center value that did not exist prior. In order to see this, I am spitting out the scenegraph to a .osg file.

Is there something extra I need to do to an LOD to flatten the transform out? I am using the osg::Optimizer to do it.

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12264

PostPosted: Thu Apr 17, 2014 8:51 am    Post subject:
Scale Flattening and LODs
Reply with quote

HI Karl,

I'm trying to guess what is going on front the details you've
provided. Are you saying that the osgUtil::FlattenStaticTransforms is
not handling LOD's correctly? Have you looked at the source code to
see what it's doing/not doing?

Robert.

On 14 April 2014 20:03, Cary, Karl A. <> wrote:
Quote:
To at least partially answer my own question, everything seems fine if I
manually apply the scale to the radius. So essentially, if you have a scale
transform, it will affect the radius, center point, ranges, and vertex
positions during the cull and draw. However if you flatten the scale, it
seems to only affect the vertex positions and center. You have to manually
adjust ranges and radius.



Is this not supposed to be true? Is there anything else that I need to be
double checking on? This is with 3.0.1.



From:
[mailto:] On Behalf Of Cary, Karl
A.
Sent: Monday, April 14, 2014 12:51 PM
To: OpenSceneGraph Users
Subject: Scale Flattening and LODs



I have run across an issue related to scaled flattening over an LOD. I have
a Matrix transform with a static scale in it over an LOD node. For the LOD,
I have exact ranges that I want it to change at, regardless of scale, i.e.
always switch LOD at 1000ft, 2000ft etc. If I leave the matrix transform in
place then I have to divide the ranges by the scale value as they get that
scalar applied to them as well apparently. This is what we have been using
for quite some time and works fine. I am trying now to flatten the scale
transform out. When I do it though, the ranges don't get touched so I don't
need to adjust them, but for some reason the raidus is also being left alone
and now suddenly there is a center value that did not exist prior. In order
to see this, I am spitting out the scenegraph to a .osg file.



Is there something extra I need to do to an LOD to flatten the transform
out? I am using the osg::Optimizer to do it.






------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Cary, Karl A.
Guest





PostPosted: Thu Apr 17, 2014 10:30 am    Post subject:
Scale Flattening and LODs
Reply with quote

Looking at the code for FlattenStaticTransformsDuplicatingSharedSubgraphs, as that is what appears to be running, the apply(LOD) function adjusts the center with a setCenter call, but there is no adjustment done to the radius. Since the setCenter call will enable the USER_DEFINED_CENTER mode, if radius is > 0 then it will need to be adjusted. Also it does not modify the ranges either, even though if you were not to flatten the transform then those ranges would be effected by the scale. For my purposes the range part does not matter, but it might to others.

-----Original Message-----
From: [mailto:] On Behalf Of Robert Osfield
Sent: Thursday, April 17, 2014 4:48 AM
To: OpenSceneGraph Users
Subject: Re: Scale Flattening and LODs

HI Karl,

I'm trying to guess what is going on front the details you've provided. Are you saying that the osgUtil::FlattenStaticTransforms is not handling LOD's correctly? Have you looked at the source code to see what it's doing/not doing?

Robert.

On 14 April 2014 20:03, Cary, Karl A. <> wrote:
Quote:
To at least partially answer my own question, everything seems fine if
I manually apply the scale to the radius. So essentially, if you have
a scale transform, it will affect the radius, center point, ranges,
and vertex positions during the cull and draw. However if you flatten
the scale, it seems to only affect the vertex positions and center.
You have to manually adjust ranges and radius.



Is this not supposed to be true? Is there anything else that I need to
be double checking on? This is with 3.0.1.



From:
[mailto:] On Behalf Of Cary,
Karl A.
Sent: Monday, April 14, 2014 12:51 PM
To: OpenSceneGraph Users
Subject: Scale Flattening and LODs



I have run across an issue related to scaled flattening over an LOD. I
have a Matrix transform with a static scale in it over an LOD node.
For the LOD, I have exact ranges that I want it to change at, regardless of scale, i.e.
always switch LOD at 1000ft, 2000ft etc. If I leave the matrix
transform in place then I have to divide the ranges by the scale value
as they get that scalar applied to them as well apparently. This is
what we have been using for quite some time and works fine. I am
trying now to flatten the scale transform out. When I do it though,
the ranges don't get touched so I don't need to adjust them, but for
some reason the raidus is also being left alone and now suddenly there
is a center value that did not exist prior. In order to see this, I am spitting out the scenegraph to a .osg file.



Is there something extra I need to do to an LOD to flatten the
transform out? I am using the osg::Optimizer to do it.



org




------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Large scale point clouds rendering wi... saedrna1 General 1 Fri Mar 08, 2019 8:01 am View latest post
No new posts Scale object based on camera distance Moohasha General 3 Fri Jan 04, 2019 4:57 pm View latest post
No new posts AutoTransform for scale 3.6.0 bcolbert General 1 Mon Jun 18, 2018 5:07 pm View latest post
No new posts VPB stability, and LODs gooznick VirtualPlanetBuilder [vpb] 1 Mon Apr 23, 2018 5:14 am View latest post
No new posts Scale problem while transforming obje... YuraIU02 General 1 Sat Apr 15, 2017 4:26 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP