PDA

View Full Version : Grow a structure from metal plates


sconlogue
05-08-2008, 02:09 PM
Working on a project that requires a mechanical assembly animation that I think will work best scripted. Just not sure where to start.

Basically you have plates of metal that duplicate or "grow" into larger structures. Initial I just want it to be somewhat random. I think I have a handle on that, issue is I need connector plates and bolts to connect each plate. I would like the connector plates and bolts to move into place rather than just appear. Would It be better to create the connector plate animation as an xref file of just the plates and bolts doing there thing? Any thoughts on an approach would help me get off on the right foot. Thanks!

davestewart
05-08-2008, 03:08 PM
Maybe post some diagrams; it's a bit difficult to get a handle on what your describing from your description ;)

sconlogue
05-09-2008, 02:16 PM
Ok, this isn't exactly what I am doing but it will help to illustrate. In the image below there is a simple structure that is made up of these "Plates" and connectors. Now image that this shot is only early in the "Growth" of the structure. We start with one of these panels and the script generates panels randomly (on 90 degrees angles only) in all directions. The script would key frame the action or whatevery so that it "Grows" over time, not just pops up a finished structure. While it is "Growing" connetors are appear where needed. Where edges meet basically. It more like one plate spawns all these other plates at a fixed rate generating a random structure as it goes. Hope that's clear.
http://www.isclient.com/posts/plates.jpg

antonv
05-09-2008, 03:09 PM
Other way you could do that is by building the whole structure from sepparate pieces and make them not visible to camera. Then, through script to turn their visibility back on based on distance to some helpers or some other geometry that you animate the way you want.

Klonsemann
05-09-2008, 03:50 PM
I would build the struture with some scriptloops at once and keyframe the visibility over time.

davestewart
05-09-2008, 04:14 PM
I think it depends what kind of animation you want, and the scale of the scene.

It could be really fun to define some behaviours and let the script do it's thing, tweaking this and that to get the desired effect.

Obviously you should work with planes first! Then swap out the geometry later.

Attached is something I was playing with in 2005.

Dave

JHaywood
05-09-2008, 06:40 PM
I would experiment with using Particle Flow to do this. And the easiest thing to do would be to start with the particles (each particle would be a plate or a connecter piece) in their final positions, create some effect that moves them away in an interesting way, and then cache the whole thing and play it backwards.

sconlogue
05-09-2008, 08:42 PM
All good suggestions. I was starting to think about a particle based approach as well. If they were particles I could also use collision detection with a dummy to change the visibility. Though the client is really looking for what dave is talking about, a more natural and automated method. Dave, I'll take a look at you attachement tonight. Thanks!

davestewart
05-10-2008, 11:58 AM
Post back what you come up with Samuel, I really like this kind of project!
Cheers,
Dave

sconlogue
05-29-2008, 05:05 PM
Ok. so I have something. Not exactly what I originally set out to do, but it's a start. Basically it's a script that creates x number of instances positioned randomly while removing duplicate objects along the way.

gap = -1
--objWidth = $.radius*2
objWidth = $.width
rollout formBuilder "form Builder" width:160 height:124
(
button btn17 "Create Form" pos:[21,15] width:115 height:33
edittext NumObjects "Number of Objects" pos:[3,56] width:152 height:16 enabled:true
progressBar pb1 "ProgressBar" pos:[8,80] width:144 height:16 enabled:true value:0
on btn17 pressed do
createForm()
)
fn createForm = (
totalObjects = formBuilder.NumObjects.text as integer
for i=1 to totalObjects do (
formBuilder.pb1.value = 100*i/totalObjects
randomNumber = random 1 6
newObject = randomInstance randomNumber
)
)
fn randomInstance r = (
if r == 1 then (duplicateUp())
if r == 2 then (duplicateDown())
if r == 3 then (duplicateLeft())
if r == 4 then (duplicateRight())
if r == 5 then (duplicateVerticalUp())
if r == 6 then (duplicateVerticalDown())
)
fn checkPosition oldPos newPos = (
currentObjects = $* as array
endArray = currentObjects.count-1
for i=1 to endArray do (
if ( isValidNode currentObjects[i] ) then (
if currentObjects[i].pos == newPos.pos then (
print newPos
delete newPos
select currentObjects[random 1 endArray]
exit()
) else if ( i == endArray ) then (
select newPos
exit()
)
)
)
)
fn duplicateUp = (
oldObj = $
newObj = instance oldObj
newObj.pos.y = oldObj.pos.y-objWidth+gap
checkPosition oldObj newObj
)
fn duplicateDown = (
oldObj = $
newObj = instance oldObj
newObj.pos.y = oldObj.pos.y+objWidth-gap
checkPosition oldObj newObj
)
fn duplicateLeft= (
oldObj = $
newObj = instance oldObj
newObj.pos.x = oldObj.pos.x-objWidth+gap
checkPosition oldObj newObj
)
fn duplicateRight = (
oldObj = $
newObj = instance oldObj
newObj.pos.x = oldObj.pos.x+objWidth-gap
checkPosition oldObj newObj
)
fn duplicateVerticalUp = (
oldObj = $
newObj = instance oldObj
newObj.pos.z = oldObj.pos.z+objWidth-gap
checkPosition oldObj newObj
)
fn duplicateVerticalDown = (
oldObj = $
newObj = instance oldObj
newObj.pos.z = oldObj.pos.z-objWidth+gap
checkPosition oldObj newObj
)
createDialog formBuilder

Here's some results I got playing around with it. Also since they are instances I can modify the objects after the fact.
http://www.isclient.com/posts/Boxes.jpghttp://www.isclient.com/posts/BigBoxes.jpghttp://www.isclient.com/posts/Spheres.jpghttp://www.isclient.com/posts/BigSpheres.jpghttp://www.isclient.com/posts/LittleSpheres.jpghttp://www.isclient.com/posts/LittleBoxes.jpghttp://www.isclient.com/posts/lattice.jpghttp://www.isclient.com/posts/lattice2.jpg

davestewart
05-29-2008, 09:40 PM
Excellent stuff!

If you like this sort of thing you should also take a look at Actionscript and Processing. Really easy and fun to build generative art.

But MaxScript is still very striong in this area. Nice job.

Some nice lighting too. How did you acheive the blooming effects?

Cheers,
Dave

CGTalk Moderation
05-29-2008, 09:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.