CGTalk > Software > Autodesk 3ds max
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 06-18-2013, 12:40 PM   #1
MadLogic325
New Member
portfolio
Mahmoud Fattouh
Creative Director
Beirut, Lebanon
 
Join Date: Feb 2011
Posts: 21
move multiple objects vertically based on x object proximity

Hi all,
so I have this project where I have near 2000 pin shaped object that reside on a certain z position which I need to move in a wave like form on z axis. Think of it as a pin box but pins should move up by rows until they all get raised up. Any suggestions on how to do that in a simple way as linking and moving 2000 object is somewhat troublesome.
I was thinking of something like a script that move an array of objects on z axis based on another object proximity.
Any suggestions are much appreciated.
Regards
 
Old 06-18-2013, 01:42 PM   #2
em3
day dreamer
 
em3's Avatar
portfolio
Dave Tyner
3D Artist
Polyform Media
Denver, United%2BStates
 
Join Date: Jan 2004
Posts: 984
Send a message via Yahoo to em3
Something like this?

http://www.youtube.com/watch?v=qzw_X-vxwYU&noredirect=1

If you were going to do this based on rows, you could have the entire row be a single mesh.

-------------------------------------------------------------------

Also, you could use this script. Not the exact same thing but it sounds ballpark to what you want.

Create a dummy and then copy some boxes. Select the boxes. This code will animate the boxes based on their relative position to the Dummy. You can move the dummy around then rerun the script.

Code:
fn compareFN v1 v2 = ( local myD = getnodebyname ("Dummy001") local d = (distance v1 myD)-(distance v2 myD) case of ( (d < 0.): -1 (d > 0.): 1 default: 0 ) ) thearr = for o in selection collect o qsort thearr compareFN t=10 For b = 1 to thearr.count do ( with animate on ( at time t thearr[b].height = thearr[b].height t+=10 at time t thearr[b].height += 10 ) )
__________________
www.davetyner.com
 
Old 06-20-2013, 07:32 AM   #3
MadLogic325
New Member
portfolio
Mahmoud Fattouh
Creative Director
Beirut, Lebanon
 
Join Date: Feb 2011
Posts: 21
The youtube tutorial is more of an object being stretched on z-axis which is not the case in my project, and my pins are randomly but tightly aligned so they form a certain image.
All I need is some sort of a script that would simply evaluate the distance (x or y) between each pin (array assignment) and the dummy object. Once the distance is under lets say 1, the pin(s) affected start moving upwards until it reaches zPosition.y in a predefined #of frames regardless of the dummy's position afterwards.
I wish I had the scripting bliss...

This how I see it work on the hope someone would translate this into a script:

Define objectArray elements ["pin001", ..., "pin2000"] ; if there's an easy way to list them.
Define objectArray elements max zPos= 0 ; as original position is at -zPos value (<0)
Define dummyVolume (BoundingBox) as dummy could be of thin but wide volume
Evaluate objectArray elements zPos.
Evaluate Current Frame
Define Dur: 15Frames
Define objectArray travelSpeed: Final zPos - Current zPos / Dur
Evaluate distance (x or y) between each Pin and the dummyVolume:
if Distance > 1 : null
else if Distance <= 1 : trigger movement on the affected Pin by travelSpeed/Frame until it reaches Final zPos and remove from evaluation.
If all Pins have a zPos value of 0 break script.

Regards.

Last edited by MadLogic325 : 06-20-2013 at 09:13 AM.
 
Old 06-20-2013, 02:43 PM   #4
em3
day dreamer
 
em3's Avatar
portfolio
Dave Tyner
3D Artist
Polyform Media
Denver, United%2BStates
 
Join Date: Jan 2004
Posts: 984
Send a message via Yahoo to em3
Quote:
Define dummyVolume (BoundingBox) as dummy could be of thin but wide volume


Why the bounding box? Do you care about the volume of the dummy or just it's position (pivot point)?

As far as I can tell either one of the solutions above should give you what you need.
__________________
www.davetyner.com
 
Old 06-20-2013, 02:43 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:51 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.