summaryrefslogtreecommitdiff
path: root/xc/unsupported/doc/PHIGS/man3/p321
blob: b3c46231f534ed7fdb30e05987e0e03de3fe3793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
.\"##
.\" $XConsortium: p321,v 5.2 94/04/17 20:58:10 rws Exp $
.\"##
.\"## 
$XMCOPY
.\"## Copyright (c) 1990, 1991 by Sun Microsystems, Inc. 
.\"## 
.\"##                         All Rights Reserved
.\"## 
.\"## Permission to use, copy, modify, and distribute this software and its 
.\"## documentation for any purpose and without fee is hereby granted, 
.\"## provided that the above copyright notice appear in all copies and that
.\"## both that copyright notice and this permission notice appear in 
.\"## supporting documentation, and that the name of Sun Microsystems,
.\"## not be used in advertising or publicity 
.\"## pertaining to distribution of the software without specific, written 
.\"## prior permission.  
.\"## 
.\"## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
.\"## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
.\"## EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
.\"## CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
.\"## USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\"## OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\"## PERFORMANCE OF THIS SOFTWARE.
.TH "SET GLOBAL TRANSFORMATION" 3P "29 February 1991"
.SH NAME
SET GLOBAL TRANSFORMATION \- create structure element containing a \s-22D\s+2
global modelling transformation matrix
.IX "Modelling and Transformation Attributes" "SET GLOBAL TRANSFORMATION"
.IX "Attributes, Modelling and Transformation Attributes" "SET GLOBAL TRANSFORMATION"
.SH SYNOPSIS
.SS C Syntax
.ft B
.ta 1.25i 3i
.nf
void
pset_global_tran ( xform )
Pmatrix	xform;	\fItransformation matrix\fP
.fi
.ft R
.SS Required PHIGS Operating States
(PHOP, *, STOP, *)
.SH DESCRIPTION
.SS Purpose
\s-2SET GLOBAL TRANSFORMATION\s+2 creates a structure element
containing a \s-22D\s+2 global modelling transformation matrix,
which, during traversal, replaces the \fIcurrent global
modelling transformation\fP.
Then the local modelling transformation is composited with the new
global modelling transformation to create a new composite modelling
transformation, which maps the modelling
coordinates \s-2(MC)\s+2 used to define individual output primitives
to a unified world coordinate \s-2(WC)\s+2 space.
.LP
If the current edit mode is \s-2INSERT\s+2,
the \s-2SET GLOBAL TRANSFORMATION\s+2 element
is inserted into the open structure after the element pointed to
by the current element pointer. If the edit mode is \s-2REPLACE\s+2, the
\s-2SET GLOBAL TRANSFORMATION\s+2
element replaces the element pointed to by the
element pointer. In either case, the element pointer is updated to point
to the new element.
.SS C Input Parameter
.IP \fIxform\fP
The 3 \(mu 3 homogeneous \fItransformation matrix\fP, of type:
.sp .3
typedef  Pfloat  Pmatrix[3][3];
.SS Execution
.LP
When traversal of a structure begins,
the initial current local modelling transformation \s-2(L)\s+2 and
the current global modelling transformation \s-2(G)\s+2
are both the \s-2\&3D\s+2, 4 \(mu 4 identity matrix.
.\"	A composite modelling transformation \s-2(C)\s+2 is by
.\"	definition \s-2G\s+2 \(mu \s-2L\s+2\(aa at all times.
The composite modelling transformation \s-2(C)\s+2 within a structure traversal
is formed by the matrix multiplication of the
current local modelling transformation \s-2(L)\s+2 and the
current global modelling transformation \s-2(G)\s+2 as follows:
.IP
C \(<- G \(mu L
.LP
\s-2PHIGS\s+2 assumes representation of points as column vectors.  Hence, the order
of composition in C \(<- G \(mu L (and throughout) is ``post-concatenation''
or ``post-multiply.''
.LP
When a new structure is traversed, one step in the
invocation of the referenced structure is to save the current modelling
transformations (\s-2L\s+2, \s-2G\s+2, and \s-2C\s+2).
The child structure inherits the parent's
composite modelling transformation \s-2(C)\s+2
as its current global modelling transformation \s-2(G)\s+2, and
an identity matrix as its initial
current local modelling transformation \s-2(L)\s+2.
The parent and child have equal composite modelling transformations \s-2(C)\s+2,
because \s-2L\s+2 is the identity.  After traversal of the child structure network,
the saved transformations are restored so that the parent is unaffected
by the execution of a child.
.LP
When the \s-2SET GLOBAL TRANSFORMATION\s+2 element is traversed,
first the element's \fItransformation matrix\fP is expanded to the \s-2\&3D\s+2
equivalent \fItransformation matrix\fP \s-2(T)\s+2 and it replaces the
current global modelling transformation \s-2(G)\s+2:
.IP
G\(aa \(<- T
.LP
The current local modelling transformation \s-2(L)\s+2,
is then composited with the new current global modelling transformation \s-2(G)\s+2
to calculate the new composite modelling transformation \s-2(C)\s+2.
.IP
C \(<- G\(aa \(mu L
.LP
The current composite modelling transformation maps the
modelling coordinates, used to define individual output primitives, to
world coordinates.
Mapping the primitives to the world coordinate space establishes the
relation between different objects of the image by redefining the parts in
terms of a unified coordinate space. This allows the application to define
different parts of the image in different local modelling coordinates
convenient to the objects being defined, and then to apply
transformations that will map the local coordinate systems of each part to
a single world coordinate \s-2(WC)\s+2 space.
.LP
Finally, the viewing mechanism maps \s-2WC\s+2 to device coordinates
on the workstation's physical display surface.
.\"? This "transformation pipeline" is described in more detail in the
.\"? \fI\s-2PEX-SI\s0 Programming Guide\fP.
.SH ERRORS
.IP 005
Ignoring function, function requires state (PHOP, *, STOP, *)
.SH SEE ALSO
.nf
.IP
.ta 0.5i
.SM "SET LOCAL TRANSFORMATION (3P)"
.SM "BUILD TRANSFORMATION MATRIX (3P)"
.SM "TRANSFORM POINT (3P)"
.SM "SET VIEW REPRESENTATION (3P)"
.SM "SET GLOBAL TRANSFORMATION 3 (3P)"
.fi