Coordinates, Orientation and Scaling

Coordinates and positioning objects:

3 Dimensions

Meme’er follows the standard Z-up 3 dimension system. Which means (the following points are from standard camera location of (0, -120, 0) looking at (0, 0, 0)):

  1. To move object left, we decrease x value and to move right, we increase x value
  2. To move objects nearer, we decrease the y value, to move it away, we increase the y value
  3. To move the objects downward, we decrease z value and to move it upwards, we increase z value.

Now, these statements applies for particular camera arrangements. If we add following to the story line

camera is at @(0, 120, 0, 0, 0, 0)

(which basically means camera is at Y +120 looking at (0, 0, 0)), then to move left we have to increase the x value. For the sake of simplicity, in this introductory tutorial, we will assume that camera is on standard location (unless we mention otherwise). Also, for current release we are not allowing setting camera orientation (like looking thigs upside down) as we are still under discussion what would be the easiest way to include it as NLP.

Now there are 2 type of objects used in Meme’er (though internally they all are treated alike): flat objects (like image or movie) and actual 3d objects (like human or openmodels objects). When working with flat objects, we have to cater for its 2 dimensions along with depth.

Objectives:

Specify location of object

Understanding 3D coords

Orientation and rotating objects:

Head, pitch, and roll

The next 3 digits are the orientation for head (also called yaw in some conventions), pitch and roll. For basic understanding, there are many good reading material (like one on Researchgate.net, or Wikipedia). Basically, when we set HPR values, the object (be it image/ video screen or 3d model rotates independently (as in rest of the universe where the object is, including the camera, remains static). In our quick startup tutorial, we have set the HPR for the lady as (180, 0, 0) which means the lady was looking away from the camera. Had it been (0, 0, 0), she would have been looking at camera. If we had set it as (90, 0, 0), she would have been walking in right direction. Please understand that the actual orientation of any 3d object depends on orientation of the base model added with what new orientation you set. So if I make a human model which is laying down on face, then with (0, 0, 0) orientation, it will still be laying down. I can “make it look like standing” by setting orientation of (0, 90, 0).

Objectives:

Specify orientation of object

Understanding head, pitch, and roll

Scaling objects:

How big my model be

The last 3 digits are the scaling. As could be clear by now, Sx is scaling along height, Sy along width along y-axis and Sz is along z-axis. Again just like the case for orientation, the actual size (along any axis) is dependent on base model. So if our model is lying down, increase in size along X-axis, will increase the width along X-axis.

What about 2 dimensional objects

2D Objects like image are a interesting case here. They do not have any width and are always rectangle (though illusion of them being something like rhombus or trapezoid etc., could be created with propoer orientation, but they will always have straight side).

For scaling of 2d models, the Sy do not have any effect. Sx increase the width and Sz increases the height. There remains a special case where we want a image or video to occupy the whole screen. We need to get the correct scaling for such case. Lets say the image is located at (0, 0, 0) while camera is at (0, -120, 0). Lets assume the screen size is set as 1080, 720.

Under user story tab, we can go to Co-ord –> Screen coordinates and check the coordinates for screen with this size. We get the following values:

Checking for
Center as [0, 0, 0]
Camera position as [0, -120, 0]
Screen Size as [1080, 720]
Top left coordinates: [-48.23085403442383, 0.0, -32.153900146484375]
Top right coordinates: [48.23085403442383, 0.0, -32.153900146484375]
Bottom right coordinates: [48.23085403442383, 0.0, 32.153900146484375]
Bottom left coordinates: [-48.23085403442383, 0.0, 32.153900146484375]
Maximum visible object length: 96.46170806884766
Maximum visible object width: 64.30780029296875

Now as we can see that maximum visible object length is 96.46 hence if we set the scaling as (96.46/108, 64.31/72) or (0.893, 0.893) we should be able to cover the screen.

Objectives:

Scaling of 3d objects

Scaling of 2d objects like images