Interactive computer graphics
A homogenous coordinate is a system that treats all the algebraic points equally in a projective plane that is both the ideal and Euclidean. When we consider the points [p1,p2,p3] at a point p, the projection of p will have the coordinates on a plane as [x,y,z] whereby the p is a point in the form of Euclidean plane. The rotation of a point or a straight line or image on the screen is done by moving the image to occupy the origin. Performing translation, which is the moving of an image from one place to another on a straight line, is done by either adding the coordinates or point or by subtracting them, whereby the picture is required to be shifted.
Homogenous is done in the designing and construction of applications like translation, rotation, scaling to fit the pictures properly. In homogenous coordinates, two dimensions are represented by (x, y). When projecting a 2D image, it is easy to identify the x and y dimensions. When considering an image projection, we can have a dimension W. This represents the distance from the projector to the screen. In the 2D dimension, the W dimension helps in determining the size of the image. When the dimension W is being increased or decreased, the image will change on the screen. When the image is moved closer to the projector, then it becomes small, and when moved away from it becomes more prominent. These affect the size of the image on the screen.
An example, assuming there is a 2D image with coordinates (10, 12), which is away from the projector by 2 meters. These will make us have the full coordinate projective as (10, 12, 2). When moving the projector closer to the image, it will become smaller since it will take two times closer to the picture. The coordinates are divided by two to achieve the image projected. These will clearly show the conversion of the correct homogenous coordinates for a 2D dimension.
Homogeneous coordinates are useful in computer graphics in different situations, like translating matrix into a 3D coordinate. When translating matrix, at least four columns are needed since rotation and scaling require three columns. A homogenous 4d vector is often used instead of three since a four matrix can only be multiplied by a four-element vector. Homogenous helps in perspective transformation, whereby is the phenomenon by which an object appears to be smaller when it is away from the camera. The perspective projections are either in vanishing points and perspective foreshortening.
When the length of the projection is increased, and the object appears to be smaller, there are vanishing points whereby the lines will appear to meet in one, two, or three points. This perspective is implemented by 3d computer graphics using matrix transformation that changes each element vertex. After the perspective projection of the element, a matrix is being performed; each vertex undergoes a perspective division whereby component of the homogenous coordinate is being converted to W=1.
When the perspective division is done, all left is a 3D coordinate that is scaled correctly into a 3D perspective projection. The most property of homogeneous coordinate is positioning directional lights that are allowing you to have point at infinity. It is not possible to convert 3d coordinates since the point of infinity usually occurs when W=0, and it is not accessible to covert homogeneous coordinates into a normal one since everything has to be divided by zero. 3D graphics are different in terms of directional light and point light. When the value of W=1, then that is considered as the point light, and when it is W=0, then it is a directional light.
Translation
This is the mapping of a point P to form a new point P’ whereby this is done when adding a constant vector b to the coordinates. This affects if mapping a point in the direction of the x-axis by the x coordinates and y-axis by the y coordinates. Translation can also be said to be shifting or moving of an object from the origin to the coordinate system. Suppose we have appoint (x .y), and we are translating the coordinate under a translation amount Bx and By. The new coordinate can be obtained by adding the Bx and By to the coordinate system (x’, y’).
Transformation can be mapped backward, that is, by mapping p’ to p. These can be done by an inverse translation that is T⁻2=trans (-b1-b2). The equation for translation is:
or
Rotation
Rotation is the process of changing the direction or the angle of an object. This is done by either doing it clockwise or anticlockwise. When rotating an object, the angle and point of rotation should be noted. When rotating an object with a positive pivot point, then the object will rotate in an anticlockwise direction. At the same time, when rotating an object using the negative value of the pivot point, the object will rotate in a clockwise direction. Rotation is done using different formalities when rotating a straight line, and endpoints are being applied using the same angle and redrawing lines between the new points.
All the polygons are being rotated by shifting all their vertex in the same rotational angle. Curved lines can be rotated by repositioning all the points and drawing up a new position. The equation for rotating a matrix in a clockwise direction is:
R=
Matrix rotation for the anticlockwise direction:
R=
Homogenous coordinates rotation for clockwise:
R=
Homogenous coordinates rotation for anticlockwise:
R=
When rotating an object about the arbitrary point first, the point is being translated about the rotation on the origin, then rotate the object at the endpoint and again translated to the origin.
Scaling
Scaling is used in changing the size of an object by either increasing or decreasing using three factors, which are Sx Sy and Sz.
Sx represents the scaling factor in the x-direction, Sy represents the scaling factor in the y-direction, and Sz represents the scaling factor in the z-direction. In 2D transformation, scaling can be obtained by multiplying the coordinate vector (x, y) by the scaling factor Sx and Sy to get (x, y’). Matrix form equation of 2D to form a scaling element is:
=
When the scaling factor is less than one, we reduce the object size, and when the scaling factor is more significant than one, the object size is increased.
When performing scaling for the coordinates (a,b,c), then first, the fixed points are being translated to the origin , scale the object relative to the origin and finally translate the object back to the origin.
Scaling equation for 3d graphics:
Shearing
This is the changing of the object shape in either x-direction or in y-direction or in both directions. It is also called deformation, objects can be distorted in 2D, but in three dimensional, it occurs in three directions.
Shearing in the x-direction is done by sliding the horizontal layers. The equation for shearing in the homogenous matrix:
Shearing of the y-direction is done by sliding along the vertical direction that is the y-axis. The equation is given by:
Shearing of both the x and y direction is done by pushing both the x and y direction or sliding the horizontal and vertical direction. The object will be distorted. The equation matrix for both the x and y shearing is given as:
Mirroring/Reflection
This is the rotating of an object about 180 degrees to produce a mirror image, either on the x-axis or the y-axis. There are different types of reflection, reflection about the x-axis whereby the value of x remains the same, and the value of y becomes negative.
Reflection about the y-axis whereby the value of x is being reversed, and the value of y remains the same, making the object to lie on the other side of the y-axis.
Reflection of the axis on the perpendicular plan along the XY axis passing through the origin, the value of both x and y is being reversed.
Reflection of an object about the line y=x whereby the object is rotated first at 45 degrees clockwise then rotated back on y=x to its original anticlockwise 45 degrees.
Affine
The affine transformation preserves all points transformed that lie on an initial line and remain on the same path. For example, when the midpoint of a translated object is found, the same midpoint will continue even without translating the object. In other ways, this indicates a particular class of transformation that does not move in any object in the affine space. This transformation is also known as affinity. Examples of affine transformation are geometric, expansion, spiral, and similarity transformation, whereby all this is a combination of rotations, translations, and shears.
Affine transformation does not necessarily transform lengths since all triangles can be transformed into any other by the use of affine transformation.
=s
=S
When solving this should result in all through to
A=s
B=-s
The scale factor is given by:
S=√a2+b2
The rotation angle is given by:
A=
The affine transformation of mapping R is given by:
F(p)=Ap+q for all p is in R.
Similarity transformation.
This is a rigid transformation which involves rotation, reflection followed by a dilation whereby when a similarity transformation is transforming an image, an image similar to the original one is being formed. Similarly, two figures will be similar when a similarity transformation is being carried out using the first image to the second image. Similarity transformation preserves angles, even if the scale factor dilation is enlarged, there will be the same corresponding angles which are the same along with the measurements.
The determinant of a similarity transformation is equal to the original matrix determinant. The state value equation for a similarity transformation is given by:
|BAB⁻₁|=|B| |A| |B⁻₁|
=|B| |A| |1/B|
=|A|
References
Paul, R. P., & Zhang, H. (1986). Computationally efficient kinematics for manipulators with spherical wrists based on the homogeneous transformation representation. The International Journal of Robotics Research, 5(2), 32-44.
Ahuja, D. V., & Coons, S. A. (1987). Interactive graphics in data processing: Geometry for construction and display. In Readings in Computer Vision (pp. 652-660). Morgan Kaufmann.
Clark, J. H. (1982). The geometry engine: A VLSI geometry system for graphics. acm siggraph Computer Graphics, 16(3), 127-133.
Riesenfeld, R. F. (1981). Homogeneous coordinates and projective planes in computer graphics. IEEE Computer Graphics and Applications, (1), 50-55.
Niem, W., & Broszio, H. (1995, September). Mapping texture from multiple camera views onto 3D-object models for computer animation. In Proceedings of the International Workshop on Stereoscopic and Three Dimensional Imaging (pp. 99-105).