-
1. Re: look at
RemusM Mar 26, 2013 9:30 AM (in response to tyree_2)Hi,
pointAt works for any object:
member(whichCastmember).model(whichModel).pointAt(vectorPosition{, vectorUp})
member(whichCastmember).camera(whichCamera).pointAt(vectorPosition{, vectorUp})
member(whichCastmember).light(whichLight).pointAt(vectorPosition{, vectorUp})
member(whichCastmember).group(whichGroup).pointAt(vectorPosition{, vectorUp})
The object’s front and up direction vectors are defined by the object’s pointAtOrientation property.
cheers
-
2. Re: look at
tyree_2 Apr 12, 2013 4:32 PM (in response to RemusM)Ill rephrase. it works but not correctly a character standing on the ground will be flipped on its back hovering in the air.so its feet are always pointing at the object.
does anyone have an example of a chracter or object other than a camera or light not loosing its own orientation when using point at
-
3. Re: look at
James Newton, ACP Apr 12, 2013 5:17 PM (in response to tyree_2)You can set the pointAtOrientation of the character.
I imagine that the character has been created with the z-axis pointing upwards and its y-axis pointing forwards. By default, a model "looks" down its negative z-axis, with its y-axis pointing up.
Try this:
model("myCharacter").pointAtOrientation = [vector(0, 1, 0), vector(0, 0, 1)]Also, you might like to ensure that the target of the pointAt() command is at the same height as the origin of the character model, so that the character remains vertical.
-
4. Re: look at
RemusM Apr 13, 2013 1:31 AM (in response to tyree_2)tyree_2 wrote:
Ill rephrase. it works but not correctly a character standing on the ground will be flipped on its back hovering in the air.so its feet are always pointing at the object.
does anyone have an example of a chracter or object other than a camera or light not loosing its own orientation when using point at
As I (and James) stated before, you need to define the "front" of the object.
The object’s front and up direction vectors are defined by the object’s pointAtOrientation property.
For example, a simple mesh and a bones controlled mesh have different points of orientation.
Inside of the 3D modeler (3DS Max) you can change the rotation of the pivots.
Also, depending on your needs, you can perform an additional operation after pointAt.
Example:
member("w3d_name").model("alien").pointAt(member("w3d_name").camera(1).transform.position, vector(0,0,-0.9999))
member("w3d_name").model("alien").rotate(90,0,0)
I hope it's cristal clear now.cheers
-
5. Re: look at
tyree_2 Apr 17, 2013 8:12 AM (in response to RemusM)thanks to both I had already tried the point at orientation with no success. which caused me to come to the forum. Ill go back and have another try at it.
I would not have considered models not having the same height. to be cause of concern when using point at. thats very problematic
-
6. Re: look at
RemusM Apr 17, 2013 1:30 PM (in response to tyree_2)tyree_2 wrote:
thanks to both I had already tried the point at orientation with no success. which caused me to come to the forum. Ill go back and have another try at it.
I would not have considered models not having the same height. to be cause of concern when using point at. thats very problematic
In fact you're looking for pointAt restricted to the Z axis:
objrot = member("w3d_name").model("alien").transform.rotation
member("w3d_name").model("alien").pointAt(member("w3d_name").camera(1) .transform.position, vector(0,0,-0.9999))
member("w3d_name").model("alien").rotate(90,0,0)
objrotZ = member("w3d_name").model("alien").transform.rotation.z
member("w3d_name").model("alien").transform.rotation = objrot
member("w3d_name").model("alien").transform.rotation.z = objrotZcheers


