Hi
I’m looking for pointers on how best to build a 3D ‘scene’ of various meshes which attach to parents/children and can therefore be controlled by transforming the parent etc.
I thought this was possible using the ofNode class but I can’t figure how to add mesh data to an existing node. Is it possible? Could anyone point me in the right direction or towards a relevant doc for how to build complex 3D scenes in oF please?
Hello @sjd, in the example folder there is examples/3d/ofNodeExample. You can chain ofPrimitive together using setParent. Each ofPrimitive inherits from a node. For exampe, if you have a box, and you want to add a sphere as a child, you do as follows:
sphere.setParent(box).
now if you move the box, the sphere will move with it.
Have a look there and feel free to ask if it is not clear
Thanks @edapx - I think of3DPrimitive is what I want.
I’m loading a model using ofxAssimpModelLoader and can display that model correctly but it doesn’t seem to inherit from ofNode so I can’t attach it to a parent etc.
However I think I can copy the data over to my of3DPrimitive instance’s mesh.
Do you know of any automated (api) way of copying all vertex, index and normal data from one mesh instance to another? Or do I have to do it all manually using loops?