Next: , Previous: Interface, Up: Modules


6.2 Example 1: Simple External Module

This section gives a very simple external module which displays an oscillating mesh. To try out this example, make a copy of the file example1.c (it is distributed with Geomview in the doc subdirectory) in your directory and compile it with the command

     cc -o example1 example1.c -lm

Then put the line

     (emodule-define "Example 1" "./example1")

in a file called .geomview in your current directory. Then invoke Geomview; it is important that you compile the example program, create the .geomview file, and invoke Geomview all in the same directory. You should see "Example 1" in the Modules browser of Geomview's Main panel; climl#OOGL-File-Formats">OOGL File Formats, and see GCL, for an explanation of the format of the data in these commands.

The main program, at the bottom of the file, first calls Initialize(). Next, the call to LakeDefine defines the Lake that the lisp library will use. A Lake is a structure that the lisp library uses internally as a type of communiation vehicle. (It is like a unix stream but more general, hence the name.) This call to LakeDefine defines a Lake structure for doing I/O with stdin and stdout. The third argument to LakeDefine should be NULL for external modules (it is used by Geomview). Finally, the program enters its main loop which parses and evaluates expressions from standard input. ./usr/share/doc/geomview/html/pt_BR/ND_002dVertices.html0000644000000000000000000000610211645225506021613 0ustar rootroot ND-Vertices - Manual do Geomview

Next: , Previous: Vertices, Up: Conventions


4.1.4 N-dimensional Vertices

Several objetos share a common style of representing vertices with optional per-vertex surface-normal and color. All vertices within an objeto have the same format, specified by the header key word.

All data for a vertex is grouped together (as opposed to e.g. giving coordinates for all vertices, then colors for all vertices, and so on).

The syntax for N-dimensional vertices (N > 3) is

`x[1] x[2] x[3] x[4] ...'
(N floating-point vertex coordinates) or
`x[0] x[1] x[2] x[3] x[4] ...'
((N+1) floating-point vertex coordinates, if the 4 modifier has been specified in the objeto's header line)

Note, however, that N-dimensional objetos internally always have (N+1)-dimensional points; the first component x[0] – if present in the objeto file – is used as homogeneous divisor. This is different from the ordinary 3D case where the 4 modifier generates a 4D objeto where the homogeneous component implicitly is set to 1.

Color components usually can be specified like for 3D vertices, see Vertices, while specifying normals does not make sense. ./usr/share/doc/geomview/html/pt_BR/figsavepanel.html0000644000000000000000000000010611645225506021522 0ustar rootroot ./usr/share/doc/geomview/html/pt_BR/soft_002dshader.html0000644000000000000000000000331511645225506021752 0ustar rootroot soft-shader - Manual do Geomview