tease tricks 2004-01-23 - By Brian Robbins
Back I agree with Barry on this one. When I first started doing this sort of thing, I would create dummy models exactly like you did Colin. At some point though, I realized that groups are really what you'd want to use instead of the models.
I'm not sure how it would be messy though. Right now you're probably:
1) creating a modelResource (box?) 2) then creating your dummy models, using that box as their resource, 3) then setting them to visibility = #none. 4) Positioning each box appropriately
In order to switch to groups, you'd simply need to change the code to 1) Create a new group (same as step 2) 2) Position the group appropriately (same as step 4)
Additionally, you will have a performance improvement. For this demo, that performance difference is probably unnoticeable, but in complex scenes with lots of dummy objects, switching from a visibility=#none to a group will speed things up, as the renderer does less work.
To conclude, in this demo there's probably very little reason to switch from dummy models to groups, as the performance benefit will be minimal. However, in the future, I'd encourage you to use newGroup() instead of a model with visibility=#none. There shouldn't be any change to your code, other than the differences between creating a group and creating a modelResource, model, and setting the visibility.
Brian Robbins Senior Creative Technologist, Fuel Industries <http://www.fuelindustries.com/>
> >>just out of curiousity, why are groups better than invisible models? > > And another thing, if I did use groups to allow the vane to swing > relative to the group's node, how would I set the group below to be > located at the position it needs to be? I guess I would have to set > it to the position of the previous group, and then translate it some > amount? Sounds messy. >
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|