Author Topic: setOrientation , Pivot3D disappear  (Read 188 times)

Hakan KIRIK   «   on: June 22, 2012, 07:34:46 AM »

Very simple...
I have got a sphere , added it to Pivot3D
And I have another Pivot3D (the target).
after I use:
 v1:Vector3D=new Vector3D(target.x,target.y,target.z);pivot1.setOrientation(v1);

.... pivot1 is disappearing. Can not see it anymore. I have checked the coordinates and visibility, everything OK.
What do I wrong? Thanks

chao chen   «   Reply #1 on: June 24, 2012, 01:27:27 AM »
Make sure v1 is not Vector3D(0, 0, 0);

Ivan Vodopiviz   «   Reply #2 on: June 25, 2012, 01:16:22 PM »
Hi,

Please note that accessing the X, Y and Z values directly gives you back the local coords of the object. You can use Pivot3D.getPosition() if you need the global ones.

Cheers,

Hakan KIRIK   «   Reply #3 on: July 02, 2012, 04:44:44 AM »

Ok, I will check your suggestions.
But why is it disappearing?
Does setOrientation change the coordinates?

Hakan KIRIK   «   Reply #4 on: July 02, 2012, 05:59:47 AM »

Why is it disappearing when I just use:

pivot1.setOrientation(new Vector3D());

Hakan KIRIK   «   Reply #5 on: July 02, 2012, 06:00:44 AM »

Please give me a simple code block where a pivot follows another pivot.

Ivan Vodopiviz   «   Reply #6 on: July 02, 2012, 11:29:49 AM »
Hi,

I'm sorry, I completely misread your post and ended up adding to the confusion. First of all, setOrientation receives a direction, so it must be a normalized vector. Setting it a position vector like you're doing now will just break it.

If you want an object to face another object you should use Pivot3D.lookAt() instead of setOrientation().

You can see a little example here.

Cheers,