I have done what you suggested. But when I need more vertices then initially allocated, I need to create a new factory, since manipulating the vertex count twice sometimes leads to wrong colors. And I don't wont to create a factory with much more vertices than I realy need.
There are some other things I found out, while searching for errors: - Genmesh considers only the object position when doing per vertex lighting, which leads to wrong results when having meshes with near lights. Maybe the current algorithm was done with performance in mind. I changed my workspace to use correct per vertex lighting, which looks much better. Maybe one could switch the calculation method based on object size and light distance. I could supply a patch if desired. - The lighting on meshobjects is not updated if the meshfactory is invalidated. One must call UpdateMove() to force a relight. Maybe this can be fixed or at least been mentioned in the documentation. Jorrit Tyberghein wrote: > I think it is best to avoid changing number of vertices or triangles > as that will mean the buffers have to be recreated. If you keep the > same number of vertices and triangles then it will be a lot faster for > hardware. You can collapse all triangles that you don't want to see to > an empty triangle somewhere in the model. > > Greetings, > > On 10/1/07, Philipp Wojke <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I want to display something like a path of an moving object. I currently >> use a genmesh consisting of an triangle strip. Every time the object >> moves I manipulate the factoryState (vertices, normals, texels, >> triangles) to represent the new path and calling Invalidate() to >> announce the changes. >> >> This works partially as the genmesh representing the path has the >> correct geometry, but it becomes black, has random colors or flickers in >> color. >> >> It looks like genmesh doesn't react well to changes in vertex/triangle >> count. How do I animate a mesh with changing vertex count correctly? >> >> I'm using CrystalSpace version 1.0 from SVN on Windows XP with VS 2005. >> >> Attached you find the source of a modified simple1 tutorial to show the >> problem. The genmesh manipulation is done in UpdateMesh(). >> >> >> Thanks, >> Philipp ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Crystal-main mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-main Unsubscribe: mailto:[EMAIL PROTECTED]
