Constrain Position of Object A to Scale of Object B

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 07 July 2013   #1
Constrain Position of Object A to Scale of Object B

Good afternoon,

Is it possible to constrain the position of object A to scale of object B? Essentially I want to scale object B in a set axis based on the distance away object A is from it.
 
Old 07 July 2013   #2
Depends on what you actually want, for connecting the position to scale the most straightforward is to use wire parameters - assign ScaleXYZ controller to object B scale transform part, rightclick the object and in the quadmenu pick Wire Parameters. After choosing for example Transform > Scale > Z Scale a dialog will pop up where you can pick for example X Position controller of object A.

If you would rather want to use relative distance instead of absolute position on one axis, scripted controllers are another way:

(
	local objectA = Point pos:[-10,0,0]
	local objectB = Box pos:[10,0,0]
	objectB.scale.controller = ScaleXYZ()

	local ctrl = float_script()
	ctrl.addTarget #pos objectA[#transform][#position]
	ctrl.addObject #self (nodeTransformMonitor node:objectB)
	ctrl.setExpression "distance pos self.pos / 100"

	objectB.scale.controller.z_scale.controller = ctrl
)
__________________
Scripts :: linkedin
 
Old 07 July 2013   #3
Try the Reaction Manager.
__________________
Renderfarm hire available @ www.hotknife.co.uk
 
Old 07 July 2013   #4
To extract the distance between two objects(and ultimately using it in a wiring operation), you can use a helper object called 'Expose Transform', it returns a lot of parameters one of which is the distance between it and a referenced object, then you can of course use that value to derive the scale of the other object the way Swordslayer described...
 
Old 08 August 2013   #5
Many thanks for the great responses regarding my original post. They have all been helpful on my quest to find a solution for this project. I am sorry for my lack of response since the original post but I was away for three weeks doing various things but am back now. Once again thank you so much!
 
Old 08 August 2013   #6
I think this can be useful to you too:

http://www.youtube.com/watch?v=9qmP...t=TLKHUqiQ6tIzQ

This guy is explaining the reaction manager in this clip, and I think he tied the scale of one object to the position of other as an example, as far as I can remember
 
Old 08 August 2013   #7
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



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 01:17 PM.


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