Page 1 of 1

Custom parametric meshes

Posted: Fri Dec 05, 2014 4:05 pm
by shviller
When you're building procedural models, you often want to abstract away some pieces that make sense on their own (a torus, a spiral, or, in fact, just about anything in this thread).

Kjell shared a neat technique that allows to imitate new "kinds" of parametric mesh producers (such as MeshTorus or MeshSpiral). I did a quick search and it seems it isn't explained anywhere on the forum, so with Kjell's blessing I decided to amend that.

Here's how:

1. Drag and drop some Variable components into your Mesh. You can't just add them right there (BTW, Ville, why is that the case? Kjell's guess is that it's because the graph editor doesn't support it), so you have to declare them somewhere else and then move them.

2. Then from the other mesh you can set the variables using a ZExpression and end with a RefreshContent + MeshLoad, like so:

Code: Select all

TorusThickness = 1;
TorusRadius = 4;

@RefreshContent(Component:TorusMesh);
@MeshLoad(Mesh:TorusMesh);
Here are some examples:

Posted: Sun Dec 07, 2014 1:27 pm
by VilleK
Nice technique, thanks for sharing. Have you built any cool geometry this way? Please post screenshots if you want, it is always fun to see what ZGE is used for.