Hi Lars,

On Fri, 2005-01-07 at 08:56, Lars Hillebrand wrote:
> Hi
> 
> Once again, i have a problem with my drawPrimitives-Method.
> Like i wrote before, i created an new NodeCore-Type named 
> "PointGeometry" using fcdEdit, derived from MaterialDrawable.
> 
> I created my own Version like this:
> 
> in OSGPointGeometry.h:
> 
> virtual Action::ResultE drawPrimitives (DrawActionBase* action);
> 
> and in OSGPointGeometry.cpp a simple version:
> 
> Action::ResultE PointGeometry::drawPrimitives (DrawActionBase* action) {
>     SLOG<<"draw!\n";
>     return Action::Continue;
> }
> 
> For testing, i used the 01hello-Tutorial and replaced the torus with my 
> point-model.
> All i see on the console is a lot of:
> 
> WARNING: MatrixPerspective: near 0 ~= far 0!
> 
> (ok, there is nothing drawn), but no "draw!".
>
> Any Idea?

Yup. To get a fully functioning Drawable you need to override two
functions: drawPrimitives and adjustVolume. If you forget the latter the
system doesn't know the bounding volume of your NodeCore and therefore
culling doesn't work. Given that the SSM also uses the bounding volume
for near/far calculations, that also explains the warning.

Take a look at Examples/Cubes, that's a pretty minimal example for
writing your own NodeCore with OpenGL rendering.

Hope it helps

        Dirk




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to