building complex models

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

building complex models

Post 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.
:idea: :!: :?:
"great expectations"
User avatar
Kjell
Posts: 1891
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post 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. :roll:
"great expectations"
alphanimal
Posts: 25
Joined: Sun Feb 27, 2011 1:09 am

Post 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!
User avatar
VilleK
Site Admin
Posts: 2280
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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.
alphanimal
Posts: 25
Joined: Sun Feb 27, 2011 1:09 am

Post 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?
Attachments
Test.zgeproj
(3.28 KiB) Downloaded 473 times
User avatar
Kjell
Posts: 1891
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
Attachments
Test.zgeproj
(3.63 KiB) Downloaded 509 times
Radius.gif
Radius.gif (20.8 KiB) Viewed 10391 times
alphanimal
Posts: 25
Joined: Sun Feb 27, 2011 1:09 am

Post 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?
User avatar
VilleK
Site Admin
Posts: 2280
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Ah, Kjell to the rescue :)

The gl-calls are direct calls to OpenGL so this is a trick to make it work.
alphanimal
Posts: 25
Joined: Sun Feb 27, 2011 1:09 am

Post 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...
Post Reply