[ Previous | Next | Contents | Glossary | Home | Search ]
The graPHIGS Programming Interface: ISO PHIGS Subroutine Reference

Chapter 15. ISO PHIGS Transformations

All coordinate data in an ISO PHIGS implementation is conceptually manipulated as three-dimensional data. An application specifies a coordinate as an x, y, z triplet, or if the application specifies a x, y pair, z=0 is assumed. All points are then represented mathematically as column vectors as prescribed by the ISO PHIGS standard. Storage of transformation matrixes which are applied to these points or column vectors is defined by the individual ISO PHIGS bindings and described below.

3-by-3 Matrix

Let the elements of an ISO PHIGS 3x3 matrix be:

 
       _        _ 
      | a  b  c  |
      | d  e  f  |
      |_g  h  i _|
 

C Binding

The ISO PHIGS C binding specifies that these elements be stored such that:

     m[0][0] = a;  m[0][1] = b;  m[0][2] = c;
     m[1][0] = d;  m[1][1] = e;  m[1][2] = f;
     m[2][0] = g;  m[2][1] = h;  m[2][2] = i;
where m is of type Pmatrix.

FORTRAN Binding

The ISO PHIGS FORTRAN binding specifies that these elements be stored such that:

     p[1,1] = a    p[2,1] = b    p[3,1] = c
     p[1,2] = d    p[2,2] = e    p[3,2] = f
     p[1,3] = g    p[2,3] = h    p[3,3] = i
where p is a 3 X 3 real matrix.

4-by-4 Matrix

Let the elements of an ISO PHIGS 4 X 4 matrix be:

 
        _          _ 
       | a  b  c  d |
       | e  f  g  h |
       | i  j  k  l |
       |_m  n  o  p_|
 

C Binding

The ISO PHIGS C binding specifies that these elements be stored such that:

 
     q[0][0] = a;  q[0][1] = b;  q[0][2] = c; q[0][3] = d;
 
     q[1][0] = e;  q[1][1] = f;  q[1][2] = g; q[1][3] = h;
 
     q[2][0] = i;  q[2][1] = j;  q[2][2] = k; q[2][3] = l;
 
     q[3][0] = m;  q[3][1] = n;  q[3][2] = o; q[3][3] = p;
 
where q is of type Pmatrix3.

FORTRAN Binding

The ISO PHIGS FORTRAN binding specifies that these elements be stored such that:

     t[1,1] = a    t[2,1] = b    t[3,1] = c   t[4,1] = d
     t[1,2] = e    t[2,2] = f    t[3,2] = g   t[4,2] = h
     t[1,3] = i    t[2,3] = j    t[3,3] = k   t[4,3] = l
     t[1,4] = m    t[2,4] = n    t[3,4] = o   t[4,4] = p
where t is a 4 X 4 real matrix.

[ Previous | Next | Contents | Glossary | Home | Search ]