Notifications
Clear all
[Closed] Align Camera with face normal…How?
Jun 17, 2006 6:28 am
Ok im trying to align the camera with the face normal usig the following…
What am i doing wrong? It seems to work on faces that are flat against x, y, z but soon as they are rotated it stops working…
myViewMatrix = viewport.getTM()
myOriginalCoordSystem = getCoordCenter()
toolMode.coordsys #local --set local coords
myLocalTransform = getTransformAxis myObj 0 --get transform matrix
viewport.setTM (myLocalTransform) --set camera to transform matrix...
max zoomext sel all
1 Reply
Jun 17, 2006 6:28 am
- get face center .
- get face normal .
- camera
s dir = face normal . -- be care , the direction of the camera is inverse direction of the camera view . 4.get camera
s lens distance . or just use ur own distance . - caculate the position for camera , should be “faceCenter + (faceNormal * lens distance )”
…
and more if u like …
if the camera is a target camera , it will be more easy to do this . ,just put the target of camera to the face center …
maybe helpful