Page 1 of 1

turn "About" spiral into single Model?

Posted: Tue Oct 25, 2011 3:37 am
by Mic
Would love a couple of hints on how to turn the "About" spiral into a single Model. A mesh would have to be created where a model is created now I think .... and a mesh can be moved about just like a model, right? How much of this can be written inside an expression? TIA,

Mic.

is there an example close to this that I can study?

or ....

Posted: Tue Oct 25, 2011 3:58 am
by Mic
can the spiral be a group of models inside a parent model where the parent model x and y can be manipulated?

really like the spiral code where models keep on being generated and the ones that are going out of bounds get removed!

just found spawn.proj ...

Posted: Tue Oct 25, 2011 6:26 am
by Mic
where main model.OnSpawn does its own OnSpawn ... changing x of mainModel moves all the "bits" so gonna play with that ..... is there an overhead to multiple models versus multiple meshes?

Re: turn "About" spiral into single Model?

Posted: Tue Oct 25, 2011 10:43 am
by Kjell
Hi Mic,
Mic wrote:Would love a couple of hints on how to turn the "About" spiral into a single Model.
Any particular reason why you'd want to do this?
Mic wrote:A mesh would have to be created where a model is created now I think .... and a mesh can be moved about just like a model, right?
All models use the same ( static ) mesh, so there's no reason to create / generate additional meshes. And, meshes can only be moved ( without being regenerated ) using the RenderTransform components .. which is what the Model component uses internally as well.
Mic wrote:can the spiral be a group of models inside a parent model where the parent model x and y can be manipulated?
Parent-child relationship / hierarchy is unfortunately not build-in yet, however you can do this yourself relatively easily.
Mic wrote:is there an overhead to multiple models versus multiple meshes?
Yes, but in most cases it is neglectable.

*Next time please edit your post instead of adding replies :wink:

K

re: About spiral

Posted: Tue Oct 25, 2011 3:47 pm
by Mic
sorry about the multiple posts - did not realize I could edit a post once it was posted!

Trying to learn ZGE by thinking of things to code - wanted to put a couple of spirals on the screen and move the whole spiral as it revolves. Looked at the way the spiral is made up of multiple models and cannot work out how to move the whole bundle ... thanks for your response .... reading it and still not sure how to do it :-)

Mic.

Re: re: About spiral

Posted: Tue Oct 25, 2011 4:43 pm
by Kjell
Hi mic,
Mic wrote:wanted to put a couple of spirals on the screen and move the whole spiral as it revolves. Looked at the way the spiral is made up of multiple models and cannot work out how to move the whole bundle
It really depends on your exact project what is the most convenient way to do this. Attached is one possible solution .. left-mouse-button toggles between movement of the 2 groups. However, in most cases this is not the preferred solution ... for the attached example I'd normally use a model that simply renders 9 sprites ( instead of spawning 9 clones ).

Hierarchy should really be build-in though .. and with the scripting enhancements of version 2.0, it shouldn't be all that difficult to add :roll:

K