XPresso: Stay within range?

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 09 September 2006   #1
XPresso: Stay within range?

HI,
how is it possible with XPresso to have an object stay within a defined distance of another master object?
So the object is freely movable but when the master moves beyond the defined distance the slave must move with it.

thanks,
 
Old 09 September 2006   #2
Calculate the difference vector (by simply subtracting one global psotion from the other) and check for the length of this vector. If it is above the limit distance multiply the normal of the difference vector by the limit distance and add it to the slave objects global position.

Cheers
Björn
__________________
- www.bonkers.de -
The views expressed on this post are my personal opinions and do not represent the views of my employer.
 
Old 09 September 2006   #3
Originally Posted by Srek: Calculate the difference vector (by simply subtracting one global psotion from the other) and check for the length of this vector. If it is above the limit distance multiply the normal of the difference vector by the limit distance and add it to the slave objects global position.

Cheers
Björn


great!
seems simple enough,
thanks
 
Old 09 September 2006   #4
"Check for the length"?

ok so how does one "check for the length" of a vector?
 
Old 09 September 2006   #5
Either use the distance node or a math node set to subtract and vector. If you use the math node you can simply use the resulting vector as a scalar (real value), xpresso will autoconvert any vector into the length of the vector if you connect a vector to a real port.
Cheers
Björn
__________________
- www.bonkers.de -
The views expressed on this post are my personal opinions and do not represent the views of my employer.
 
Old 09 September 2006   #6
Originally Posted by Srek: Either use the distance node or a math node set to subtract and vector. If you use the math node you can simply use the resulting vector as a scalar (real value), xpresso will autoconvert any vector into the length of the vector if you connect a vector to a real port.
Cheers
Björn


ok thanks. and i suppose i'll have to make a user data field to input the required max distance away from the master object at which to make the slave a child of the parent. (using the virtual Parent preset from the content browser).

Last edited by allanalogy : 09 September 2006 at 01:37 PM.
 
Old 09 September 2006   #7
right so i've sorta got it working:

the distance between the "Master" Cube and the "Pet" Sphere is found then this is compared with a distance set by a User Data slider on the "Master" Cube. If the output is greater than the setting on the User Data slider,then the Virtual Parent XPresso is enabled.

However when i drag the "pet" sphere too quickly it goes beyond the invisible bounds set by the "masters" user data and gets stuck.

Anyone know how I can prevent this?

I've attached the file.

thanks,
Attached Files
File Type: zip master pet.c4d.zip (7.8 KB, 21 views)
 
Old 09 September 2006   #8
Howdy,

I'm not sure, but is this what you were trying to achieve?

Adios,
Cactus Dan
__________________
It doesn't matter what people say about you, just as long as they're talking about you.

cactus3d.com, cactus3d-Plugins, CD Character Plugins forum
 
Old 09 September 2006   #9
thanks CD!
thats exactly what i needed! Its a thing of beauty! Calling it a FIX is a HUGE understatement. I'm kinda disappointed that i was so way off.

I see that "virtual parent" wasn't even necessary.

Now i need to dissect this and figure out how to give one "master" multiple "pets".

thanks again,
 
Old 09 September 2006   #10
Howdy,

You're welcome.

Adios,
Cactus Dan
__________________
It doesn't matter what people say about you, just as long as they're talking about you.

cactus3d.com, cactus3d-Plugins, CD Character Plugins forum
 
Old 09 September 2006   #11
Howdy,

You can also string them together like this.

Adios,
Cactus Dan
__________________
It doesn't matter what people say about you, just as long as they're talking about you.

cactus3d.com, cactus3d-Plugins, CD Character Plugins forum
 
Old 09 September 2006   #12
Thumbs up

hey that's pretty cool!

I was trying to give you another "useful" credit in the thread, but was told that i couldn't. :(

My main reason for neding this XPresso was because i am animating a character that needs to do high flying somersaults and cartwheels.

(the characters are in my portfolio)

I didnt want the IK targets to get too far out of reach when i move the character.
So I was thinking I'd use this XPresso to keep the foot and hand targets from falling too far behind.

the reason i used virtual parent before was so that if i rotate the "master" the "pets" would rotate too as if they were children of the "master".

However I'll be using a different null for those rotations anyway

thanks

Last edited by allanalogy : 09 September 2006 at 12:45 AM.
 
Old 09 September 2006   #13
I've changed a couple of things:

I moved the User Data slider to the "pets" so they can be easily copied without have to adjust the XPresso.
They can also have individual "Leash Lengths" set by their own sliders.

cheers
Attached Files
File Type: zip InvisibleLeash.c4d.zip (8.6 KB, 41 views)
 
Old 10 October 2006   #14
Talking

This is "not at range" but maybe useful

Cheers
Renato
Attached Files
File Type: zip RtVariant.zip (8.7 KB, 23 views)
__________________
Plugins Site: renato-tarabella.com

VRayforC4D Site: www.vrayforc4d.net/

Last edited by RenatoT : 10 October 2006 at 10:32 PM.
 
Old 10 October 2006   #15
thanks

Originally Posted by RenatoT: This is "not at range" but maybe useful

Cheers
Renato


that's pretty cool!
So anything can be dropped into the null object and it will begin to follow along in turn.
and the "Multiplier" slider regulates how close they stay to the "Master"
I'll have to look at it more closely to see how u did it.

thanks Renato
 
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 03:00 AM.


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