PDA

View Full Version : Forced to position along a line


ready
03-09-2008, 07:22 AM
I am forced to apply a position on a single axis relative to an object in rotation
I object "A" which is spinning in a circle
I want to coerce another object "B" report by the subject "A" by coercion position
But I wish that the object "B" follows the "A" on the horizontal axis as in the picture.
Someone can help me?

DAVID:-D
03-09-2008, 11:56 AM
Link parameters, thats easiest way.

Search for "Parameter Connection Editor" in XSI wiki

or put simple expression to B X transform - "A.kine.global.posx"

3DMastermind
03-25-2008, 06:04 PM
This sounds alot like the gun turret I posted once...
Here it is again.
In order to direction constrain the box (in one axis) to the black sphere,
the 'Green' sphere was introduced.

Run script and click play.



CreatePrim "Cube", "MeshSurface"
GetPrim "Sphere"
SetValue "sphere.sphere.radius", 1.909
Translate , 20.0800766438126, 0, 0, siRelative, siLocal, siObj, siXYZ, , , , , , , , , , 0
Translate , 0, 10.1774115927083, 0, siRelative, siLocal, siObj, siXYZ, , , , , , , , , , 0
Duplicate "sphere", , 2, 1, 1, 0, 0, 1, 0, 1, , , , , , , , , , , 0
Translate , 0, 0, 0, siAbsolute, siPivot, siObj, siY, , , , , , , , , , 0
CopyPaste "sphere.kine.local.posx", , "sphere1.kine.local.posx", 1
CopyPaste "sphere.kine.local.posz", , "sphere1.kine.local.posz", 1
SelectObj "cube", , True
ApplyCns "Direction", "cube", "sphere1"
ActivateVertexSelTool
AddToSelection "cube.pnt[1,3,5,LAST]", , True
ActivateVertexSelTool
Scale , 0.123595505617978, 0.123595505617978, 0.123595505617978, siRelative, siLocal, siObj, siXYZ, , , , , , , , 0
SelectObj "sphere", , True
ActivateObjectSelTool
Translate , -51.1970724300474, -1.77635683940025E-15, 27.2850482494317, siRelative, siView, siObj, siXYZ, , , , , , , , , , 0
Translate , 0, -51.5237959206949, 0, siRelative, siLocal, siObj, siXYZ, , , , , , , , , , 0
SaveKey "sphere.kine.local.posx,sphere.kine.local.posy,sphe re.kine.local.posz", 1, , , , False
SetValue "PlayControl.Key", 100
SetValue "PlayControl.Current", 100
Translate , 68.3907688771745, 0, -48.3810451734775, siRelative, siView, siObj, siXYZ, , , , , , , , , , 0
Translate , 0, 81.5554445749718, 0, siRelative, siLocal, siObj, siXYZ, , , , , , , , , , 0
SaveKey "sphere.kine.local.posx,sphere.kine.local.posy,sphe re.kine.local.posz", 100, , , , False
SetValue "PlayControl.Key", 52
SetValue "PlayControl.Current", 52
Translate , 15.844195722278, 0, 10.6398149136693, siRelative, siLocal, siObj, siXYZ, , , , , , , , , , 0
SaveKey "sphere.kine.local.posx,sphere.kine.local.posy,sphe re.kine.local.posz", 52, , , , False
SetValue "PlayControl.Key", 1
SetValue "PlayControl.Current", 1
MakeLocal "sphere1.display", siNodePropagation
SetValue "sphere1.display.wirecolorr", 0.125
SetValue "sphere1.display.wirecolorg", 0.878
SetValue "sphere1.display.wirecolorb", 0.125
DeselectAll