Read and write data in egg files. How can I do it?

hello! I really need help …
I need an example how to change vertex data of existing egg file on C++. can this be done at all?

I think may be that

http://www.panda3d.org/manual/index.php/Reading_existing_geometry_data

is what I need… but I don’t know pyton… Can someone tell how to do it on c++

Do you want to change the egg file, and write out a modified egg file; or do you want to change the geometry for rendering after the egg file has been loaded, and render the modified geometry without writing out it? They’re different problems.

For the first problem, you would use the egg library, which is documented in the API reference, beginning with EggData. In this mode would would operate directly on egg structures, not on renderable geometry.

For the second problem, you would indeed use the page you linked to in the manual (and surrounding pages). I believe there are examples in the forum using GeomVertexWriter and the like in C++, but technical description (and the Python code) given in the manual should also be a valuable resource, even for a C++ programmer.

David

I have a 3d model made in blender or in some 3d redactor… and I need that my program can change some parameters of this model (like radius or height or form of some part).
What is the easiest way to do it?

It’s still not 100% clear what you want to do, but I assume you want to transform some pieces of your model after you have loaded it, for the purposes of rendering.

In this case, you don’t have to manipulate the vertices at all. Just find the piece you want by name and scale it, something like this:

model = loader.loadModel('myModel.egg')
piece = model.find('**/myPiece')
piece.setScale(2)

David