How to constraint an object to a normalized vector

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
  05 May 2013
How to constraint an object to a normalized vector

Hey, I'm trying to constraint an oject to a normalized vector or a radius.
Thing is I want to use only 1 node so I need to put the constraint while keeping the posXYZ on the same object.


I still want to be able to move this object freely so I still need the pos XYZ.

Kinda like an attachment constraint on a sphere when the set position is on.

So far ive been able to constraint my object to a normalize vector using a simple position script but then I loose the ability to move it and have to move it using another controller.

is this possible? if yes How?
 
  05 May 2013
Originally Posted by mrfred: Hey, I'm trying to constraint an oject to a normalized vector or a radius.
Thing is I want to use only 1 node so I need to put the constraint while keeping the posXYZ on the same object.


I still want to be able to move this object freely so I still need the pos XYZ.

Kinda like an attachment constraint on a sphere when the set position is on.

So far ive been able to constraint my object to a normalize vector using a simple position script but then I loose the ability to move it and have to move it using another controller.

is this possible? if yes How?

Are you try to use "Position List" controller? That way works "Freeze Transform" from quad menu.
__________________
Looking in the right side. [bgaTools]
 
  05 May 2013
Thanks, but that's not what I want to achieve. I dont want the tracks the be frozen and store a 0 position/rotation. I want to snap an object on an invisible sphere and be able to move it while being attached to this invisible sphere so AT ALL TIME his distance from the origin of the invisible sphere is the lenght of the sphere radius or the normalized vector
 
  05 May 2013

 with redraw off, undo off
 (
 	delete objects
 	
 	b = box name:"sticky" width:10 length:10 height:10 pos:[0,0,1] wirecolor:orange isselected:on
 	s = sphere name:"imaginary" radius:50 segments:32 wirecolor:gray
 
 	c = b.position.controller = Position_List()
 	c.setname c.count "Free Position" 
 	s = c.available.controller = Position_Script()
 	c.setname c.count "Sticky Script"
 
 	s.addconstant "radius" 50
 	s.addobject "free" b.position.controller[1].controller
 	s.setexpression "(normalize free.value)*radius - free.value"
 
 	s = b.rotation.controller = Rotation_Script()
 	s.addobject "pos" b.position.controller
 	s.setexpression "(arbAxis (normalize pos.value)).rotation"
 )
 


as usually after i show a solution many say: "Of course. It's so simple..."
 
  05 May 2013
Cool, didnt really need the ball tho but getting rid of it was quick easy anyway. Thanks for the tip.

The box is pretty sensible tho, i'll try to slow it down
 
  05 May 2013
Originally Posted by mrfred: didnt really need the ball tho but getting rid of it was quick easy anyway.

check how i call the ball in my sample...
 
  05 May 2013
no worries that was already fixed when I posted as i sad this was an easy fix
 
  05 May 2013
Thank you, Denis!
__________________
www.davetyner.com
 
  05 May 2013
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 10:54 PM.


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