Page 1 of 1
building complex models
Posted: Mon May 24, 2010 8:27 pm
by y offs et
Currently, one can build complex 3D models with workable collision ( a building with entrances and interior features ) by making individual models of walls, floors, ceilings, doors, etc., and placing them. What makes me hesitate, is how to make this chunk of labour portable.
How could one bind all the pieces together in a unit that could be moved, cloned, and copied to another window, and still be functional relative to it's new environment? There would have to be a model/sub-model hierarchy.

Posted: Mon May 24, 2010 8:34 pm
by Kjell
Can you be a little more specific? And instead of moving complex systems from one project to another, create a zgeproj framework instead.
K
Posted: Mon May 24, 2010 11:11 pm
by y offs et
Wait a sec., I think I'm seeing problems that don't exist. You can use spawnModel/useSpawnerPosition in the onSpawn list of the main model, and then just move a group. You've been there, done that.

Posted: Sun Mar 13, 2011 1:22 am
by alphanimal
I'd like to know that too!
How can one transform multiple Models as a group?
In my case, I want to rotate the whole object, consisting of many models, around the origin.
I could just set camera position and rotation, but there's gotta be a better way!
Is it not possible to make a model a child of another, so that it always inherits it's transformation?
Is it not possible to apply Transformation in general to all models before the camera transformation is being applied?
thanks!
Posted: Sun Mar 13, 2011 5:02 pm
by VilleK
It is not possible to have a parent-child transformation between models, but you can use a single model with nested RenderTransformGroup, Repeat and RenderMesh components to achieve the same effect. It will give better performance than using separate models.
Posted: Sun Mar 13, 2011 5:54 pm
by alphanimal
I think I need these objects to be different models...
How would you make this thing rotate?
Do I really have to set the camera position and angle?
Posted: Sun Mar 13, 2011 6:12 pm
by Kjell
@alphanimal : See attached ..
By the way, you might want to tone down the collision radius a little. Right now the radius is large enough for each particle to "collide" with all of the others 90% of the time.
K
Posted: Sun Mar 13, 2011 6:46 pm
by alphanimal
Thanks!
I see this is the code that makes it rotate:
Code: Select all
glPopMatrix();
glRotatef(App.Time*90,0,1,0);
Can you explain what that does?
Why did you put it inside the "Mol" model?
Posted: Sun Mar 13, 2011 7:03 pm
by VilleK
Ah, Kjell to the rescue
The gl-calls are direct calls to OpenGL so this is a trick to make it work.
Posted: Sun Mar 13, 2011 8:29 pm
by alphanimal
OK thanks guys, I'll just take it as given
A structured transformation hierarchy would be a cool feature though...
You already have parent/child models, so adding a switch "inherit transformation" or something like that should do the trick...