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 

回复: 回复: Understanding osg::CulingSet::pixelSize() andcomputePixelSizeVec tor()


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Young
Guest





PostPosted: Sat Aug 05, 2017 8:04 am    Post subject:
回复: 回复: Understanding osg::CulingSet::pixelSize() andcomputePixelSizeVec tor()
Reply with quote

Hi Robert,
I think you are right.
I am tring to use the PIXEL_SIZE_ON_SCREEN mode of LOD, and the most important is how to get a proper piexl threshold which used in the setRange(). So I want toknow is there a method to compute the pixel of the bounding sphere without the matrix (W, P, M).


My method is piexlParameter = bound.radius * bound.radius * C, and C is a empirical value. Is there a better method?


I am looking forward to your reply.
Young.


------------------ 原始邮件 ------------------
发件人: "Robert Osfield";<>;
发送时间: 2017年7月31日(星期一) 晚上7:34
收件人: "OpenSceneGraph Users"<>;

主题: Re: 回复: Understanding osg::CulingSet::pixelSize() andcomputePixelSizeVector()



Hi Young,

On 31 July 2017 at 10:19, Young < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Is _pixelSizeVector meaning the ratio of space distance to screen pixel?


I don't recall off the top of my head, but looking at the code from CullingSet:

/** Compute the pixel of an object at position v, with specified radius.*/
float pixelSize(const Vec3& v,float radius) const { return radius/(v*_pixelSizeVector); }


The _pixelSizeVector is a set of ratio that give the size in local coordinates of a pixel in screen space projected to a given distance away from the eye point.


I'm not wording this well, it's a very long time since thought about the code - it's not a bit of the OSG discussed much, it just quietly works away doing it's job. I've written lots of code over the years and if it works fine you really don't need to retain much knowledge about it...


Robert.

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


Joined: 18 Mar 2009
Posts: 11190

PostPosted: Sun Aug 06, 2017 9:32 am    Post subject:
回复: 回复: Understanding osg::CulingSet::pixelSize() andcomputePi xelSizeVector()
Reply with quote

Hi Young,

You can't work out pixel size in screen coordinates of an object in local coordinates with the window, projection and modelview matrix, the only thing you can do is cache the appropriate combination of these as CullingSet does.


Robert.


On 5 August 2017 at 09:03, Young < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Robert,
I think you are right.
I am tring to use the PIXEL_SIZE_ON_SCREEN mode of LOD, and the most important is how to get a proper piexl threshold which used in the setRange(). So I want toknow is there a method to compute the pixel of the bounding sphere without the matrix (W, P, M). 


My method is     piexlParameter = bound.radius * bound.radius * C,  and C is a empirical value.  Is there a better method?


I am looking forward to your reply.
Young.


------------------ 原始邮件 ------------------
发件人: "Robert Osfield";< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>;
发送时间: 2017年7月31日(星期一) 晚上7:34
收件人: "OpenSceneGraph Users"< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>;

主题: Re: 回复: Understanding osg::CulingSet::pixelSize() andcomputePixelSizeVector()



Hi Young,

On 31 July 2017 at 10:19, Young < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Is _pixelSizeVector  meaning the ratio of space distance to screen pixel?


I don't recall off the top of my head, but looking at the code from CullingSet:

        /** Compute the pixel of an object at position v, with specified radius.*/
        float pixelSize(const Vec3& v,float radius) const { return radius/(v*_pixelSizeVector); }


The _pixelSizeVector is a set of ratio that give the size in local coordinates of a pixel in screen space projected to a given distance away from the eye point.


I'm not wording this well, it's a very long time since thought about the code - it's not a bit of the OSG discussed much, it just quietly works away doing it's job.  I've written lots of code over the years and if it works fine you really don't need to retain much knowledge about it...


Robert.



 







_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
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 回复: Understanding osg::CulingS... robertosfield General 1 Mon Jul 31, 2017 9:20 am View latest post
No new posts Understanding osg::CulingSet::pixelSi... robertosfield General 1 Mon Jul 31, 2017 8:27 am View latest post
No new posts Wrong understanding of tangent space ... Assassin General 1 Wed May 06, 2015 11:28 am View latest post
No new posts Wrong understanding of tangent space ... Assassin General 0 Wed May 06, 2015 11:28 am View latest post
No new posts basic understanding wrong or my calcu... Assassin General 0 Sat Apr 18, 2015 7:31 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