summaryrefslogtreecommitdiff
path: root/xc/unsupported/doc/PHIGS/man3/p387
blob: 527170aad5ac748c5a520daee3df07272a35d6ea (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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
.\"##
.\" $XConsortium: p387,v 5.2 94/04/17 20:58:58 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 VIEW REPRESENTATION 3" 3P "29 February 1991"
.SH NAME
SET VIEW REPRESENTATION 3 \- define \s-2\&3D\s+2 view representation entry on a
workstation
.IX "Transformation Matrix" "SET VIEW REPRESENTATION 3"
.IX "Viewing" "SET VIEW REPRESENTATION 3"
.IX "Attribute Representations" "SET VIEW REPRESENTATION 3"
.SH SYNOPSIS
.SS C Syntax
.ft B
.ta 1.5i 3i
.nf
void
pset_view_rep3 ( ws, index, rep )
Pint	ws;	\fIworkstation identifier\fP
Pint	index;	\fIview index\fP
Pview_rep3	*rep;	\fIview representation\fP
.fi
.ft R
.SS Required PHIGS Operating States
(PHOP, WSOP, *, *)
.SH DESCRIPTION
.SS Purpose
\s-2SET VIEW REPRESENTATION 3\s+2 defines a view representation entry
in the workstation's view table, using a three-dimensional model.
A view representation defines how the composited objects are
to be represented in relation to the viewer.
.LP
A view representation controls the viewing stage of the transformation
pipeline, which transforms coordinates in
World Coordinates \s-2(WC)\s+2 to Normalized Projection Coordinates \s-2(NPC)\s+2,
and optionally clips to the limits of \s-2NPC\s+2 space.
.SS C Input Parameters
.IP \fIws\fP
The identifier of the workstation for which the view
representation is being defined.
.IP \fIindex\fP
The view index of the entry being defined.
.IP \fIrep\fP
A pointer to a structure containing the 
values in the \s-2\&3D\s+2 view representation, defined as follows:
.nf
.ta .5i +\w'Pinterstyle     'u +\w'orientation_matrix;    'u
.sp .4
typedef struct {
.sp .2
	Pmatrix3	ori_matrix;	/* orientation matrix */
	Pmatrix3	map_matrix;	/* mapping matrix */
	Plimit3	clip_limit;	/* clipping limits */
	Pclip_ind	xy_clip;	/* \fIx-y\fP clipping indicator */
	Pclip_ind	back_clip;	/* back clipping indicator */
	Pclip_ind	front_clip;	/* front clipping indicator */
.sp .2
} Pview_rep3;
.sp .2
.fi
.IP
Pmatrix3 is defined in phigs.h as follows:
.sp .2
typedef  Pfloat  Pmatrix3[4][4];
.IP
Plimit3 is defined in phigs.h as follows:
.sp .4
.nf
.ta .5i +\w'Pfloat     'u  +\w'xmin;     'u
typedef struct {
.sp .2
	Pfloat	x_min;	/* x min */
	Pfloat	x_max;	/* x max */
	Pfloat	y_min;	/* y min */
	Pfloat	y_max;	/* y max */
	Pfloat	z_min;	/* z min */
	Pfloat	z_max;	/* z max */
.sp .2
.fi
} Plimit3;
.bp
.IP
Pclip_ind is defined in phigs.h as follows:
.nf
.ta .5i +\w'PIND_CLIP,  'u
.sp .4
typedef enum {
.sp .2
	PIND_NO_CLIP
	PIND_CLIP
.sp .2
} Pclip_ind;
.fi
.IP
The \fIori_matrix\fP is the 4 \(mu 4 homogeneous
\fIview orientation matrix\fP,
probably from \s-2EVALUATE VIEW ORIENTATION MATRIX 3\s+2.
.IP
The \fImap_matrix\fP is the 4 \(mu 4 homogeneous
\fIview mapping matrix\fP,
probably from \s-2EVALUATE VIEW MAPPING MATRIX 3\s+2.
.IP
The \fIclip_limit\fP contains the 6 Pfloat clipping limits:
\fIxmin\fP, \fIxmax\fP,
\fIymin\fP, \fIymax\fP,
\fIzmin\fP, and \fIzmax\fP.
.IP
The \fIxy_clip\fP contains the \fIx-y\fP clip indicator
for the \fIx\fP and \fIy\fP axes.
.IP
The \fIback_clip\fP contains the back clipping indicator,
which controls clipping against the \fIback\fP plane, sometimes called 
the \fIyon\fP plane.
.IP
The \fIfront_clip\fP contains the front clipping indicator,
which controls clipping against the \fIfront\fP plane, sometimes called 
the \fIfore\fP plane.
.\".IP
.\"Valid clipping indicators are one of the enumeration values:
.\".ta .5i +1.5i +1i
.\".nf
.\"	\fIClip Indicator	Meaning\fP
.\".sp
.\"	\s-2PIND_CLIP\s+2	``Perform Clipping''
.\"	\s-2PIND_NO_CLIP\s+2	``Do not Clip''
.SS Execution
\s-2SET VIEW REPRESENTATION 3\s+2 defines a view representation entry
in the workstation's view table using a three-dimensional model.
.LP
The \fIcurrent view index\fP attribute applied
to each output primitive at traversal time determines which view
representation is used to map the primitive from \s-2WC\s+2 space to
\s-2NPC\s+2 space, typically with a
parallel or perspective projection.
.LP
This viewing process for each output primitive is accomplished in three stages:
.IP 1.
The \fIview orientation matrix\fP is applied to orient
View Reference Coordinate \s-2(VRC)\s+2 space with regard to
\s-2WC\s+2 space.  Use the utility function \s-2EVALUATE
VIEW ORIENTATION MATRIX 3\s+2 to generate this matrix
from a \fIview reference point\fP, \fIview plane normal vector\fP,
and \fIview up vector\fP specified in \s-2WC\s+2.
The view reference point becomes the origin of \s-2VRC\s+2;   
the view plane normal and the view up vector orient the \s-2VRC\s+2 
space (\s-2VRC\s+2 \fIu\fP and \fIy\fP axes) in relation to 
the \s-2WC\s+2 axes.
.IP 2.
The \fIview mapping matrix\fP is applied to map the \s-2VRC\s+2
system to the \s-2NPC\s+2 system. Use the utility function
\s-2EVALUATE VIEW MAPPING MATRIX 3\s+2 to generate this matrix. The
utility accepts a specified \fIview volume\fP called a window in \s-2VRC\s+2 space
to be mapped onto a specified \fIprojection viewport\fP in \s-2NPC\s+2 space.
The projection is established in relation to the \fIprojection reference 
point\fP, also specified in \s-2VRC\s+2 space.
The projection may be perspective or parallel, oblique
or non-oblique.
.IP 3.
Clipping limits are optionally applied. The \fIview clipping limits\fP
define an area of \s-2NPC\s+2.  When a clipping
indicator is set to \fIClipping\fP, any portion
of an object beyond that limit is not displayed.
.IP
\fBNote\fP: These clipping limits are typically identical to the
projection viewport provided to
\s-2EVALUATE VIEW MAPPING MATRIX 3\s+2. If the clipping limits differ
from the projection viewport, the object portions mapped by the
view mapping matrix to be within the clipping limits in \s-2NPC\s+2 are
displayed.
.LP
In any case, objects are subject to workstation clipping, which
may not be disabled.  The maximum volume of \s-2NPC\s+2 space that may
be displayed is from 0 to 1 in all dimensions.
.\".RE
.LP
The immediate visual effect of changing a view representation depends on
the workstation's \fIdisplay update state\fP. When \s-2SET
VIEW REPRESENTATION\s+2 is called, the display update state may prohibit
immediate updating (that is, regeneration) of the workstation's display.
In this case, the \fIview index\fP view table entry's
\fIviewing transformation update state\fP is set to \s-2PENDING\s+2, and the
following values for the entry
are set to the values being \fIrequested\fP by the function invocation:
.RS  
.ta 0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i
.LP
\(bu	Requested view orientation matrix
.LP
\(bu	Requested view mapping matrix
.LP
\(bu	Requested view clipping limits
.LP
\(bu	Requested \fIx-y\fP clipping indicator
.LP
\(bu	Requested back clipping indicator
.LP
\(bu	Requested front clipping indicator
.ta
.RE
.LP
The next time the workstation is updated, for any view table
entry with the viewing transformation update state set to \s-2PENDING\s+2,
the values stored in the \fIrequested\fP entries
replace the corresponding \fIcurrent\fP values for that view index,
and the view entry's viewing transformation update state
is set to \s-2NOTPENDING\s+2. Then regeneration proceeds, and
the new viewing representations take effect.
.SS Default Representation
View index 0 is the default for the
\fIcurrent view index\fP in the traversal state list.
View table entry 0 is the default view representation, and cannot be changed.
The effect of the default representation is to map the cube [0,1] \(mu [0,1]
\(mu [0,1] in \s-2VRC\s+2 space to the cube [0,1] \(mu [0,1] \(mu [0,1] in 
\s-2NPC\s+2 space,
without any scaling, rotation, or translation, and to clip the image in
\s-2NPC\s+2 space at the boundaries of the same unit cube.
It contains the following values:
.RS
.ta 0.2i +0.5i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i
.LP
\(bu	view orientation matrix			\fIIdentity Matrix\fP
.LP
\(bu	view mapping matrix			\fIIdentity Matrix\fP
.LP
\(bu	view clipping limits			\fIXmin \(eq 0 Xmax \(eq 1
                          	                       Ymin \(eq 0 Ymax \(eq 1
                          	                       Zmin \(eq 0 Zmax \(eq 1\fP
.LP
\(bu	\fIx-y\fP clipping indicator			\fIPerform Clipping\fP
.LP
\(bu	back clipping indicator			\fIPerform Clipping\fP
.LP
\(bu	front clipping indicator			\fIPerform Clipping\fP
.fi
.RE
.\".DT
.SH ERRORS
.IP 003
Ignoring function, function requires state (\s-2PHOP\s+2, \s-2WSOP\s+2, \s-2*\s+2, \s-2*\s+2)
.IP 054
Ignoring function, the specified workstation is not open
.IP 057
Ignoring function, specified workstation is of category \s-2MI\s+2
.IP 115
Ignoring function, the view index value is less than one
.IP 150
Ignoring function, setting this view table entry would exceed
the maximum number of entries allowed in the workstation's view table
.IP 153
Ignoring function, invalid view clipping limits;
\s-2XMIN \(>= XMAX, YMIN \(>= YMAX,\s+2 or \s-2ZMIN > ZMAX\s+2
.IP 154
Ignoring function, the view clipping limits are not within \s-2NPC\s+2 range
.SH SEE ALSO
.nf
.IP
.ta 0.5i
.SM "SET VIEW INDEX (3P)"
.SM "EVALUATE VIEW ORIENTATION MATRIX (3P)"
.SM "EVALUATE VIEW MAPPING MATRIX (3P)"
.SM "SET VIEW TRANSFORMATION INPUT PRIORITY (3P)"
.SM "INQUIRE VIEW REPRESENTATION (3P)"
.SM "UPDATE WORKSTATION (3P)"
.SM "SET VIEW REPRESENTATION (3P)"
.fi