1
$\begingroup$

Imagine an object, for example a Cube.

Now Imagine the Camera.

Imagine that, whatever the position of the camera is, you always want (a certain face of) the Cube to face the camera.

This means that the normal of the Cube's pointing-towards-the-camera-face will change.

Now at the same time I would like the Cube to rotate around its (Z-)normal ... such that it is spinning around at a constant speed (the input can be the animation's timeframe).

I have been trying for days but I can't make it work.

Also note that non-animation-nodes dynamic ways to let an object face the camera (e.g. Object constraint and Track to) do not seem to make it easy to let the object, at the same time spin around itself ...

MWE

enter image description here

Please download the MWE-blend file ->

$\endgroup$
1
$\begingroup$

Use a combination of parenting and constraints. An empty with a trackto constraint can point to the camera, a cube that is a child of the empty will follow the location and rotation of the empty but as a child, it can also have its own rotation animation.

  • Starting with a cube, that has an identifiable face, set it up to rotate on its z-axis

rotating cube

  • Add an empty and position it on the face, in this example I used a cone to visualise the direction.

an empty positioned on teh face

  • Now when you move the empty, the cube follows and continues to rotate.

  • Add a trackto constraint to the empty. Set this to track the camera. Now as you move the empty, the cube follows and the specific face is always facing the camera.

the trackto constraint

Now the camera can move anywhere, the cube will keep rotating and its face will always be facing the camera.

the setup following the camera as it moves

If you also want the camera to track the cube, you will need two empties, the other to be the parent of the camera, with both children having trackto constraints to follow the opposite empty. This is how a piston can be setup.

|improve this answer|||||
$\endgroup$
  • $\begingroup$ You wrote "Now when you move the empty, the cube follows and continues to rotate." How is this so? As from your explanation, they are two different objects. $\endgroup$ – Vincent Mia Edie Verheyen Jan 9 at 7:02
  • 1
    $\begingroup$ @VincentMiaEdieVerheyen While at worlds origin the cube rotates. As the cube is a child of the empty, it follows the empty's movements. After the parents movement and rotation is followed the childs animation allows it to rotate as if the parents current position is the world origin. $\endgroup$ – sambler Jan 9 at 9:22
1
$\begingroup$

Parent the camera to the object, in this case, the cube.

Simple as that.

enter image description here

|improve this answer|||||
$\endgroup$
  • $\begingroup$ This is interesting. In your GIF, are you rotating the cube? What I need is, while the cube is spinning around its Z axis, the camera can certainly not rotate around the scene like that. There are many other objects and lights and so on in the scene. $\endgroup$ – Vincent Mia Edie Verheyen Jan 7 at 22:05
  • $\begingroup$ I am rotating the cube, and the camera is following the cube's motion as a result of the parenting. $\endgroup$ – stphnl329 Jan 7 at 22:06
  • $\begingroup$ Please note in my original question that I want the Cube's orientation (even though it has to spin around its axis) to be camera-dependent, not the other way around. I don't want the position of the camera to be automatically adjusted to the rotation of the cube. $\endgroup$ – Vincent Mia Edie Verheyen Jan 8 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.