<div dir="ltr">Hi Young,<div><br></div><div>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.</div><div><br></div><div>Robert.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 5 August 2017 at 09:03, Young <span dir="ltr"><<a href="mailto:337533078@qq.com" target="_blank">337533078@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi Robert,</div><div>I think you are right.</div><div>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). </div><div><br></div><div>My method is piexlParameter = bound.radius * bound.radius * C, and C is a empirical value. Is there a better method?</div><div><br></div><div>I am looking forward to your reply.</div><div>Young.</div><div><div><br></div><div style="font-size:12px;font-family:Arial Narrow;padding:2px 0 2px 0">------------------ 原始邮件 ------<wbr>------------</div><div style="font-size:12px;background:#efefef;padding:8px"><div><b>发件人:</b> "Robert Osfield";<<a href="mailto:robert.osfield@gmail.com" target="_blank">robert.osfield@<wbr>gmail.com</a>>;</div><div><b>发送时间:</b> 2017年7月31日(星期一) 晚上7:34</div><div><b>收件人:</b> "OpenSceneGraph Users"<<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.<wbr>openscenegraph.org</a>>; </div><div></div><div><b>主题:</b> Re: [osg-users] 回复: Understanding osg::CulingSet::pixelSize() andcomputePixelSizeVector()</div></div><div><div class="h5"><div><br></div><div dir="ltr">Hi Young,<br><div class="gmail_extra"><br><div class="gmail_quote">On 31 July 2017 at 10:19, Young <span dir="ltr"><<a href="mailto:337533078@qq.com" target="_blank">337533078@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Is _pixelSizeVector meaning the ratio of space distance to screen pixel?<br></blockquote><div><br></div><div>I don't recall off the top of my head, but looking at the code from CullingSet:<br><br> /** Compute the pixel of an object at position v, with specified radius.*/<br> float pixelSize(const Vec3& v,float radius) const { return radius/(v*_pixelSizeVector); }<br><br></div><div>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.<br><br></div><div>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...<br><br></div><div>Robert. <br></div><div><br></div><div> </div></div></div></div></div></div></div><br>______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
<br></blockquote></div><br></div>