# Cinema 4D and increment of pixels per second of camera movement as it is in After Effects?

#1

Does someone now how to do this position offset? I cannot find this unit in the preferences of C4D. Thank you

#2

Whatâ€™s that unit to be? Pixels at what resolution/dpi/output size, and in which distance of the camera? You can probably calculate that relatively simple for a non-perspective (flat) projection, but if you include perspective, youâ€™d need to take the frustrum into account.

For the horizontal, e.g.: the width of the camera frustrum is equivalent to the width of the rendered image (because thatâ€™s what the camera sees) but since the frustrum is a pyramid stump, a view plane closer to the camera is much smaller in world coordinates than a view plane farther away.

Thus, you need to state how far away from the camera your pixel is going to be, to transform it to world coordinates.

#3

Hi Cairyn and thank you for your reply. My problem is really simple, it doesnâ€™t have anything to do with perspective. Instead do imagine to have simple Null object which must offset at one axis for 100 px per frame. But i cannot find this unit in preferences and even in the coordinates because there isnâ€™t any like this.

So is there any chance to offset object just for 100 px?, there is only cm units in the basic settings in C4D,â€¦

#4

It has everything to do with perspectiveâ€¦ if you have two cubes of the same size, but one is farther away than the other, the one that is farther away appears smaller (= has less pixel). So, even within the same final image, an identical world unit translates to a different amount of pixels. Thatâ€™s why â€śpixelsâ€ť cannot be a unit in C4D.

So, for your calculation, if you want to determine the world units that your null shall move, you need to know the camera settings and the distance of the null from the camera.

Letâ€™s assume your image is 1000 pixels squared, and the camera has a hor/vert field of view of 45Â° (just for the simplicity of things, this is not a standard camera). Place a polygonal square in 0,0,0 that has a size of 200x200 cm / world units. The camera is -1000 units away on the z axis and looks straight at 0,0,0. How big is the polygon in pixels in the final image?

For the height of the frustrum in 0,0,0, you need the tangens of 45/2 (ground plane to frustrum upper plane), which is 0.4142135623730950488016887242097. That is only the height in a unit circle though; your camera is 1000 units away so you get 414.21356 (rounded). Also, itâ€™s only the measure from the center to the top (as per the definition of sine), so we double it to get 828.42724something.

That is how many world units you can see on an XY plane in z=0. (If you build that scene, and you make your polygon 828.427 units high and wide, the corners of the polygon will precisely touch the green lines of the camera frustrum.)

Your polygon is 200 world units high so that is the 4.14213th part of the total height. Starting out with a render of 1000 pixels height, as we have assumed, the polygon will appear as 1000/4.14213 = 241.42168 pixels.

I just verified that in a real render and get 241 pixels plus some gray antialiasing pixel stuff around.

So, now you just need to insert your camera field of view, your render measure, your camera distance, and then invert the formula to calculate how many world units your 100 pixels in that xy plane are. Note: If your distance is a diagonal, you may need to calculate both x and y, although (I donâ€™t want to think too much) for square pixels that should not make a difference. And if your null moves in the depth instead of just the camera xy plane, you need to calculate all of that for the start and end point and interpolate.

#5

Thank you Cayrin for your explanation in very detailed way, thank you for that. But i have been asking for the solution of how to move Null object to 100 px in one axis in the world space coordinates (i do not mean to offset the object from the view of camera), in the very same way as you can do it in After Effects.

My problem is that there in the Cinema 4D there is not PX unitâ€¦ so what is the workaraund for this.

#6

Cairyn has explained that c4d does not use pixels as units.

that being said, if there is no z offset you can do it fairly easily by using an image plane at the correct final resolution. Assuming your null is on the same z space you can work it out.

100px_x.c4d (430.4 KB)

#7

how to move Null object to 100 px in one axis in the world space coordinates

The concept doesnâ€™t exist in 3D space, and thatâ€™s why there are no pixel units in real life except for within displays. When people mention a display size, they talk about real-world units, like inches and centimeters - the description is 55-inches for example, and not 8000-pixels, because pixels donâ€™t describe a length, only a resolution.

After Effects was built on a 2D core, with 3D tacked onto it, and thatâ€™s why it uses pixels as its base unit even though it is meaningless in 3D space.

You can test this with 2 different 3D solids - set one to a Z position of 0, and the other one to 100000. Then try to move both by a few â€śpixelsâ€ť in the X direction. They will both move by different distances, and youâ€™re not really moving them by the screen pixel amounts at all, but by the arbitrary 3D unit that After Effects uses.

#8

If you are familiar with 2D terms. This is similar to someone asking how many pixels he needs to print an image and doesnâ€™t know about DPI. The perspective is what translates one into the other, it is just a bit more complicated in 3D than in 2D.