Special effects: questions about modifying geoms

Hi folks,

I’m still working on my special effects ideas. I came to the conclusion that I will take the following approach: create a NodePath object procedurally and implement the effects then with manipulation of the vertexes of the object, which is suitable at least for some of the effects I have in mind. This approach is documented within the manual.

As I digged in the reference I found also references to modifyGeom, but no further details. The forum spits out only one article which gives indication that I have to take this function to be able to manipulate the Geom at all.

My question is: is it possible to add/change the GeomPrimitives of an Geom? Can I add or remove e.g. new lines or triangles of the Geom?

Or would it be better to create a new “version” of a Geom (with the required manipulations) and to replace the Geom with the new version?
Is this the idea behind setGeom? To replace a Geom with a new one?

The effect I have in mind is: visibly animate the creation an object with manipulation of the vertexes and GeomPrimitives (growing out of the floor, e.g.).

Thanks for any pointer/input,
Andrew

You can add/change the primitives of a Geom. This is what the modifyGeom() call exists for.

Basically, you can get a Geom from a GeomNode using either getGeom() or modifyGeom(). The two calls are more or less equivalent, but if you use getGeom(), you should not modify the resulting Geom. If you use modifyGeom(), you can do anything you like with it.

Or, you can call setGeom(), and completely replace an existing Geom with a new one you have already created. Your choice.

There is a similar trio of function calls for getVertexData() / modifyVertexData() / setVertexData(), getPrimitive() / modifyPrimitive() / setPrimitive(), and so on. They all work the same way.

David