Anyone knows how to offset the position of sub-meshes?
I'd like to explode something by manipulating the position and rotation of the submeshes.
Offseting sub-meshes - positioning submeshes
Re: Offseting sub-meshes - positioning submeshes
You can't.... the reason is that you'd have to re-set the world transformation matrix for your shader/program or the thing that emulates it in fixed function pipeline.
In theory its possible but you'd need to do it before every draw call of a meshbuffer.
In theory its possible but you'd need to do it before every draw call of a meshbuffer.
Re: Offseting sub-meshes - positioning submeshes
How about multiply the sub-mesh offset matrix by the original transform matrix, call SetTransform with that in the node's Render() proc, having passed the same offset matrix to the shader previously, and the following mesh or node render, reset the matrix... that should work, right? The GPU will simply recalc the vertices using the last matrix set. My shader code knows which sub-mesh is which, so that's covered...
Re: Offseting sub-meshes - positioning submeshes
What are you trying?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Offseting sub-meshes - positioning submeshes
Just explode the model, it just requires a new transform for each submesh, the Irrlicht parent-child code does the same thing.
Re: Offseting sub-meshes - positioning submeshes
How do you split the model? -separate it into submeshes- or is it already "exploded"? Perhaps you could create a particle system out of the model's triangles and move each triangle as a single particle randomly, or following any other method (if it doesn't have many triangles, namely 3000-5000 it may very well run completely on the CPU
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Offseting sub-meshes - positioning submeshes
Parent/child maybe the keyword for you to search for it.
Re-creating Irrlicht with Vulkan: http://irrlicht.sourceforge.net/forum/v ... =6&t=52404
Re: Offseting sub-meshes - positioning submeshes
Skinning also does something similar. Each bone is in essence, a transformation matrix for a subset of the mesh, which holds parent/child relationships, so, you could use a sort of skinned mesh
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt