Editing User:NyahCh3ck20/Proposal

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 13: Line 13:
  
 
== Programming Background ==
 
== Programming Background ==
Languages: C(Very Good), Java(learning/Intermediate), C++(learning/basic)
+
Languages: C(Excellent), Java(learning/Intermediate), C++(learning/basic)
  
C:
+
C: Wrote over a thousand lines of c code to increase performance of a sorted online dictionary used by French speaking students in our University using a redblack tree.
  
Wrote over a thousand lines of c code to increase performance of a sorted online dictionary used by French speaking students in our University using a redblack tree.
+
  Implemented a fibonnacci heap to demonstrate how it can increase performance of the Dijkstra's algorithm used in solving the single-source shortest path problem used in graph search.
  
Implemented a fibonnacci heap to demonstrate how it can increase performance of the Dijkstra's algorithm used in solving the single-source shortest path problem used in graph search.
+
​Java: Currently working on a Medical app to be integrated into the university website to determine the body mass Index of students in relation to the Health Awareness Initiative of the University.
 
 
​Java:
 
Currently working on a Medical app to be integrated into the university website to determine the body mass Index of students in relation to the Health Awareness Initiative of the University.
 
  
 
=  Project Information =
 
=  Project Information =
Line 34: Line 31:
  
 
===        Introduction  ===
 
===        Introduction  ===
The Pull/unpush command/routine is a high priority project for BRL-CAD. The pull command seeks to restore the original state of the csg tree from any particular node after the push command has been executed. However, the Push  command is used to walk the geometry tree from a specified head node to the leaf nodes(primitive level), collecting the matrix transformations such as (translations, rotations or scales) applied to new assemblies using matrix edits(oed command). The push then applies the matrix transformation parameters to the primitives, eliminationg the need for storing the various matrix transformations thereby setting them to identity matrices. This process however looses any local coorrdinate system used in constructing the geometric objects. The pull routine seeks to restore the original tree state by reversing any tranformation operations performed on the primitive shapes from a designated top node on the csg tree. Here, I would like to show my detailed proposal in solving this summer's project. My code patch will have a sample routine that takes as argument a designated node(such as a primitive) and performs the Inverse of any rotation, Inverse of any translation and the inverse of a scale.) and performs the matrix inverse the primitive matrix.
+
The Pull/unpush command/routine is a high priority project for BRL-CAD. The pull command seeks to restore the original state of the csg tree from any particular node after the push command has been executed. However, the Push  command is used to walk the geometry tree from a specified top to the primitive level, collecting the matrix transformations such as (translations, rotations or scales) applied to new assemblies using matrix edits(oed command). The push then applies the matrix tranformation parameters to the primitives, eliminationg the need for storing the various matrix transformations thereby setting them to identity matrices. This process however looses any local coorrdinate system used in constructing the geometric objects. The pull routine seeks to restore the original tree state by reversing any tranformation operations performed on the primitive shapes from a designated top node on the csg tree. Here, I would like to show my detailed proposal in solving this summer's project. My code patch will have a sample routine that takes as argument a designated node(such as a primitive) and performs the Inverse of any rotation, Inverse of any translation and the inverse of a scale.) and performs the matrix inverse the primitive matrix.
  
  
Line 101: Line 98:
 
so the Inverse  of a translation simply reverses the direction of the vector or matrix
 
so the Inverse  of a translation simply reverses the direction of the vector or matrix
 
if TrnA = (a, b ,c , d)  Inverse(TrnA) = (-a, -b, -c, -d)
 
if TrnA = (a, b ,c , d)  Inverse(TrnA) = (-a, -b, -c, -d)
 
 
==The Inverse of the Transformation==
 
 
The key point mathematically is the reversibility of the transformations.
 
 
For 3D, the typical transformation is
 
 
[ new_x ]    [ Xx Xy Xz Tx ]  [ x ]
 
[ new_y ]  =  [ Yx Yy Yz Ty ]  [ y ]
 
[ new_z ]    [ Zx Zy Zz Tz ]  [ z ]
 
[  1  ]    [  0  0  0  1 ]  [ 1 ]
 
 
which is usually written as
 
v = M p
 
where v is the transformed vector, p the original vector, and M the transformation matrix (that includes rotation, scaling, and moving).
 
 
Because the matrix is formed as a 4-by-4 matrix as above, transformations can be combined via matrix multiplication (new matrix on the left side):
 
Mcombined = Mlater Mearlier
 
.
 
 
Because each transformation is reversible, there is also an inverse matrix
 
  M` M = I.
 
 
Thus, starting at a leaf in the object tree, the current transformation matrix on the left is multiplied with the new transformation matrix, to obtain the one that applies to the current object). The transformations are cumulative from the root to the leaf.
 
 
Reversing the matrix M is very simple (Xx' means transformed Xx component of the matrix, and so on):
 
D  = Determinant(M) = Zz Xx Yy - Zz Yx Xy - Zx Xz Yy - Zy Xx Yz + Zy Yx Xz+  Zx Xy Yz
 
 
Xx' = (Yy Zz - Zy Yz) / D
 
Xy' = (Zy Xz - Xy Zz) / D
 
Xz' = (Xy Yz - Yy Xz) / D
 
Tx' = ( -Xy Yz Tz + Xy Zz Ty + Xz Tz Yy - Xz Zy Ty - Tx Yy Zz + Tx Zy Yz) / D
 
Yx' = (-Yx Zz + Zx Yz) / D
 
Yy' = (Zz Xx - Zx Xz) / D
 
Yz' = (-Yz Xx + Yx Xz) / D
 
Ty' = (Xx Yz Tz - Xx Zz Ty + Ty Zx Xz - Yz Zx Tx - Yx Xz Tz + Yx Tx Zz) / D
 
Zx' = (Yx Zy - Zx Yy) / D
 
Zy' = (-Zy Xx + Zx Xy) / D
 
Zz' = (Yy Xx - Yx Xy) / D
 
Tz' = (-Tz Xx Yy + Tz Yx Xy + Zx Tx Yy + Zy Xx Ty - Zy Yx Tx - Zx Xy Ty) / D
 
 
So When the cummulative matrix is stored for each object,and its inverse any matrix transformation can be applied  in the object coordinates. This is simply done by multiplying the transformation with the object coordinates for any object; which then gives the transformation in the root coordinate system. When this is then applied to the left with each of the transformation matrices, the original transformation matrix is obtained in local object coordinates / transformations.
 
  
 
===  Overall Structure Pull routine  ===
 
===  Overall Structure Pull routine  ===

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)