Rotate multiple objects as camera rotates
I have multiple objects in a scene (possibly many), and I have a camera. I want all the of objects in the scene to rotate as the camera rotates.
I have this working if I group the camera with an invisible sculpt and then apply an Advanced Rotator to the group. I transmit the speed outputs from the Camera Group rotator to all the objects in the scene (which have their own rotators).
I want to achieve the above effect but without requiring a rotator + sculpt grouped on the Camera gadget. The reason for this is so that I can move/rotate the camera with keyframes and transistions while still being able to rotate all the scene objects.
I tried using the Rotation Sensor gadget, but it only outputs Orientation, Acceleration, and Velocity. I need Rotational Speed rather than Velocity in order for me to be capable of transmitting the observed Camera speed out to Rotators on all the scene objects.
-
I also tried out the Look At Rotator such that the scene objects look at the camera, but this method results in all the object looking at the same point in space. What I actually want is for all the objects to constantly maintain a parallel orientation (i.e. one specific side of a cube object is always parallel to the flat plane of the camera no matter how the camera rotates).
-
What is the exact effect you're looking to create? I have a feeling there is an easier way somehow...
-
I want to ensure that no matter where the camera moves in a horizontal plane, that certain objects are always front-facing the camera (not pointing at the camera but parallel to its viewing plane). So if my camera is looking at Face A of a cube, and it rotates around the cube to the right, the cube will rotate too so that the camera is always looking at Face A (and never sees any other side of the cube). However this was assuming the camera was centered on the cube, if the cube is off center screen, then the camera would see the side of the cube, but the camera face is still parallel to Face A.
I solved for this last night and just have to implement it now.
The Orientation values from sensors are converted to be in the range of 0-360deg (they are normally 0 to 180 and -0 to -180).
The camera's 0-360 orientation is broadcast to the watcher objects, who also have their own 0-360deg orientation. The camera orientation is the destination, and the watcher's orientation is the source position.
We can get the absolute value of the difference between the destination and source to determine the degrees between them within the 0-360deg range.
If the abs difference is <= 180 and source is < destination then we will rotate CounterClockwise to the destination.
If the abs diff is <= 180 and source is > destination then we will rotate Clockwise to the destination.
If the abs diff is > 180 and source is < destination then we will rotate Clockwise to the destination.
If the abs diff is > 180 and source is > destination then we will rotate CounterClockwise to the destination.
So basically what is happening is that the Watchers are listening to the Orientation of the Camera, and rotating themselves the shortest possible distance to match the orientation of the camera. If they orientations match, they are not rotating. If they orientations dont match then they are rotating. Hopefully with enough rotational speed the effect will look mostly seemless....tbd.
Perhaps there is still an easier way to achieve a similar visual though. -
Wanted to update here to say that I found an easier solution to the problem.
The Look At Rotator has an input/output for Scene Space Direction. I grouped a Camera with a Sculpt and put a Look At Rotator on it; this allows me to output (via Wireless Transmitter) the Camera Group's Scene Space Direction.
I then have a Look At Rotator on objects that I want to align with the camera. I get the Camera Group's Scene Space Direction (via Wireless Receiver) and input it into the Look At Rotator on the object I want aligned.
So now when the Camera is rotated, all the objects aligning with it will also rotate. There is then just some fiddling with the Speed, Strength, and Dampening values on the Look At Rotators to make sure the aligning objects can keep up with the camera and not bounce around.
Zaloguj się, aby dodać komentarz.