Yes, could you send to osg-submissions that little bit of documentation,
in the right place, that would have helped you?  This is a case of a
shortcoming of the "code's user interface", and you are uniquely qualified
to know exactly where & what would've helped.

This goes for everyone that has tried to RTFS but still not found their
answer.

Thanks
-- mew


On Fri, February 15, 2008 01:53, Aitor Moreno wrote:
> Hi Mike, all,
>
> In fact, before sending the mail to the mailing list, I searched in the
> code
> where was the "rendering of the cone"....
>
> I found it in the ShapeDrawable.cpp >> line 578 (checkout OSG tag 2.2.0)
>
> void DrawShapeVisitor::apply(const Cone& cone)
> ...
>
> In that function there is only a glTranslate ... at the very beginning ...
>
> glTranslatef(cone.getCenter().x(),cone.getCenter().y(),cone.getCenter
> ().z());
>
> I thought that the cone.getCenter() would return the center I passed in
> the
> cone constructor... but, I guess it is not.
>
> Now that it seems that the code is doing was it is expected, i.e, it is a
> feature :), I found that in the line
>
> float topz=cone.getHeight()+cone.getBaseOffset();
>
> The getBaseOffset is defined in the include file Shape, just in the
> declaration of the Cone class.
>
> (line 287 of Shape)
> inline float getBaseOffsetFactor() const { return 0.25f; }
>
> And there it is the 0.25 factor!!!!
>
> I would suggest to document it a little bit, at least in the cone class
> declaration, so the auto documentation would include that the center of
> the
> cone is the Centroid, instead of the tip, the center of the base, or
> whatever...
>
> Bye.
>
>
>
>
> On Thu, Feb 14, 2008 at 11:47 PM, Mike Weiblen <[EMAIL PROTECTED]>
> wrote:
>
>> Hi,
>>
>> The origin of the cone is at its center of mass, not its geometric base.
>>
>> osgShapes are internally defined parametrically, rather than in terms of
>> triangles, so as to be used as intersection volumes, etc.  The fact that
>> they are also drawable is just a convenience overload of their primary
>> purpose.
>>
>> This is a recurring misconception/FAQ, and deserves to be documented
>> clearly. Could you have a look at the code, and if it's not clearly
>> documented, pls submit a code change that puts comments where you would
>> have found them.
>>
>> Thanks
>> -- mew

Mike Weiblen -- Austin Texas USA -- http://mew.cx/

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to