NAME

scene - Create and manipulate 3D scenes widgets

SYNOPSIS

scene pathName ?options?

STANDARD OPTIONS

-background

See the options manual entry for detailed descriptions of the above options.

WIDGET-SPECIFIC OPTIONS

-width -height -ident -double -rgba -depth -orthographic -accum -alpha -stencil -stencilsize -depthsize -redsize -greensize -bluesize -alphasize -accumredsize -accumgreensize -accumbluesize -accumalphasize

Command-Line Name:    -ident
Database Name:    ident
Database Class:    Ident

Specifies a string value that may be used has a flag to identifiate this window. Default to the empty string.

Command-Line Name:    -double
Database Name:    double
Database Class:    Double

Specifies a boolean value that indicates whether or not the user is asking for a double buffered window. Defaults to true.

INTRODUCTION

The scene command creates a new window (given by the pathName argument) and makes it into a 3D scene renderer widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the scene such as its colors and 3-D relief. The scene command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.

Scene widgets implement a state machine, based on the OpenGL API.

WIDGET COMMAND

The scene command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:

pathName option ?arg arg ...?

Option and the args determine the exact behavior of the command. The following widget commands are possible for scene widgets:

pathName move x y z

Move the camera to the given absolute coordinate. The camera direction is not changed.

pathName translate dx dy dz

Translate the camera. The camera direction is not changed.

pathName rotate teta ?-axe x y z?

pathName fog ?-color color? ?-density density? -start -end -mode

pathName dump
pathName print

pathName vertex
pathName color

pathName begin ?mode?
pathName end

pathName lbegin
pathName lend

pathName read filename
pathName read -file filename
pathName read -data string

pathName reset

pathName groups

pathName plot

pathName sphere
pathName disk
pathName cylinder

pathName material tag ?args?

Manage the material database for the scene. A material is defined with its reflecting properties, and eventually a texture.

BINDINGS

In the current implementation, new scenes are not given any default behavior. You'll have to execute explicit Tcl commands to give the scene its behavior.

CREDITS

Even if no code comes from it, the developpment of this 3D scene widget has been inspired by the Togl widget from Brian Paul (the author of the so great Mesa library). The Togl widget was however not yet ported to Win32 platform when this project was initiated, whereas it was our first need. Furthermore, the Togl widget requires C programming, whereas we had the need for a pure portable scripting approach. We have the hope that, whereas Togl is particulary suitable in offering to OpenGL developpers an easy way to build a GUI for their application, our scene widget might help the Tcl/Tk communauty in easily  providing some 3D functionnalities in their applications.


© 2000 Evolane - tous droits réservés.

© 2001-2002 Evolane - tous droits réservés. Pour toute remarque, envoyez un courrier électronique à webmaster@evolane.com