view:shaded
List of: Scheme Extensions
Subjects: Viewing
Contents: Graphic Interaction

Action: Enables and disables shading of faces within an OpenGL view.

Filename: gi/gi_scm/view_scm_gi.cxx

Syntax: (view:shaded [on-off] [view=active])

Arg Types: view view

on-off boolean

Returns: view

Description: The on-off argument enables (#t) and disables (#f) shading within a view. When disabled and model edges (view:edges) enabled, the result is similar to a wireframe representation only without the silhouette lines.


Shading (view:shaded) and edge (view:edges) display must be enabled for doing "fake" hidden line (view:hiddenline).


Displaying edges while shading of faces is turned off is not the same thing as a wire frame representation. An ACIS wire frame representation shows silhouette lines, whereas displaying edges does not. The following figure shows the silhouette lines of a wire frame representation of a cylinder (on the left) and the edges of a cylinder with face shading turned off (on the right).



Figure 3-4. Silhouette lines versus Edges

Limitations: This extension is available on all platforms, but produces results only on NT using OpenGL. Works in OpenGL views only. When shading is turned off, view:edges should be enabled, otherwise nothing will be visible.

Example: ; view:shaded

; Define a view.

(define view1 (view:gl))

;; #[view 1075519376]

; Define a block.

(define block1


(solid:block (position 0 0 0)


(position 25 20 30)))

;; block1

(define cyl1


(solid:cylinder (position -10 -10 -10)


(position -10 -10 30) 5))

;; cyl1

; Verify that edges are turned on

(view:edges #t view1)

;; #[view 1075519376]

; If edges are not turned on, you won't see

; anything when shading is turned off.

; Turn shading off.

(view:shaded #f view1)

;; #[view 1075519376]

; The edges of the model should be visible.

; Note that silhouettes are not visible on the

; cylinder.

; Verify that shading is turned on

(view:shaded #t view1)

;; #[view 1075519376]

; Turn on polygon offset to make edges easier to see

(view:polygonoffset #t view1)

;; #[view 1075519376]
PDF/GI/03SCV.PDF
HTM/DATA/GI/GI/03SCV/0032.HTM