Hi Maurizio,
Maurizio Lodo schrieb:
Hi all,
Finally I found some time to play with this. Thanks to your words of wisdom, I
have decided to create my cylinder geometry. I used the drawinstanced example
as a template and I managed to generate the cylinders, translate them and
rotate them as I want.
However I notice that when I get closer to these cylinders, they disappear,
while ojects created using ShapeDrawable do not disappear. I do not know
anything about GLSL (or OpenGL or OpenSceneGraph for that matter) and I was
wondering if anyone could tell me why this is happening, if there is a way to
fix it and if that would affect performance.
If you use VertexShaders to change vertex coordinates you must provide
the BoundingBox yourself because OSG is only able to calculate the
bounding box of the unmodified/uninstanced geometry. You can provide
the actual boundingBox using a computeBoundingBox callback.
To still take advantage of culling use should use multiple geometries
and organize your them spatially.
You should also be aware that intersection testing
(LineSegmentIntersector/PolytopeIntersector) will not work
as expected with drawInstanced even if you provide the proper boundingBoxes.
Thank you very much!
Cheers,
Maurizio
Cheers,
Peter
--
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier,
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org