What’s the preferred way to animate the positions of a set of GeomPoints?
There are several options:
(1) Use an Actor with joints and/or blend shapes (“morphs”).
(2) Use the particle system.
(3) Directly modify your vertices using a GeomVertexWriter.
(4) Use a vertex shader.
(5) Probably some more options.
There is no one “preferred” solution; each of the above has some advantages and some disadvantages. The best approach for your needs depends entire on your specific circumstances.
My question was way too vague…sorry
Modifying the vertices is probably the way to go for me as I need to procedurally control individual points as part of a simulation. I was working on this but couldn’t quit figure out how to do it.
As a test, I tried this:
vdata = vwriter.getVertexData()
data = vdata.modifyArray(0).getHandle().getData()
But that gives me a “const” error. What’s the correct way of modifying existing vertex data?
Use modifyHandle instead of getHandle.
Normally, you shouldn’t have to mess around with either getHandle() or modifyHandle(), though, since both of those are very low-level functions. You can use those if you really want to, and you have some new data already preformatted and ready to load into the vertex data, but usually you would just use the setData3f(…) etc. series of methods on GeomVertexWriter, as described in the manual under Modifying existing geometry data and related pages.
OK, got it working. Thanks much guys! I don’t know exactly how I missed that section in the manual