Next Previous Contents

4. Objects

4.1 Contents

4.2 Node

The node object has no name field. The body can contain any number of objects and properties. The command creates a new node of type container ( DVcontainer) . This node is the child of the node corresponding to the { } which enclose the command, or the dv.top, if the command is not enclosed by any other.

All the objects created within { and } are related to the created node. All the properties declared within { and }apply to the node, which means that they apply to all the objects related to it, except if the object redeclares the same property.

The set of { } pairs in the scene actually create a tree structure.

4.3 Animation node

Name field:

animate

The animation node object is similar to the node object, with the only difference in the way the objects inside it are rendered. While the objects depending on a simple node are all rendered simultaneously, the objects contained in an animation node are rendered one by one, depending on the frame number. This has the effect of creating an animation from the objects contained in the animation node.

The body of the animation node can contain any number of objects and properties. The command creates an object of type DVselection_container. This kind of node is attached to the scene tree the same way as any other type of node.

The animation node has the following specific properties:

firstFrame number

This sets the first frame for the animation. Giving this parameter a value greater than 1, you can start the animation with any of the objects contained in the animation node.

stepFrame number

This property sets a culling factor for the animation. Thus, if this parameter is greater than 1, only each number objects will be rendered.

notAnimate number

This parameter allows you to visualize all the animation node as a usual, non animated node. If the value of this parameter is 1, then all the objects in the node will be rendered simultaneously, and the animation window will have no effect on them anymore. If this property is present without a number, then it is assigned the 1 value by default.

optimize

If this property is turned on, then all the other nodes in the tree structure will be turned into animation nodes, and the objects inside them will be multiplied by the number of frames in the animation. This choice is not recommended unless the objects that are static in the scene have a small size compared to the others.

lastFrame number

This property sets the last frame in the animation. By default the last frame is set to the maximal number of objects in all the animation nodes from the tree. If this property is set to a lower number than the number of objects, then all the animations will be cut after this number of frames. If this number is bigger than the number of objects, then the last part of the animation will render empty objects.

speed number

This property is linked to the animation speed. The number specifies the number of frames per second in the animation.

Example:

animate {

firstFrame 1
stepFrame 1
notAnimate 0
optimize
lastFrame 10
speed 20
lines {...}
}

4.4 Axes

Name field:

axes

The axes object is normally used for a frame in the 3D space and is defined by a center and 3 directions. Thus, the body of the axes object can contain:

By the fact that the center of the axes is in the first place of the body, if you want to specify some non default direction, you must also include the center explicitly, or else the first direction will be read as the center.

The properties used by the axes objects are:

Example:

axes {

1 0 0
0 1 1
1 0 1
1 1 0
color { <0 0 1> 0}
color { <1 0 0> 1}
color { <1 1 0> 2}
width { 2 }
}

The scale, translate, and rotate properties also apply to the axes object in the usual way.

4.5 Boxes

Name field:

boxes

A set of boxes is defined by a number of boxes strings. Each box is defined by two opposite corners which will be linked by the x, y and z planes. If the corners are in the same x, y or z plane, then the box is a rectangle.

The body of the set of boxes can contain nothing, in which case the boxes are set by default to 1 box string containing 1 box defined by the corners:

0.0, 0.0, 0.0,
1.0, 1.0, 1.0

If the set of boxes is defined by the user, then the first element of the boxes object body must be a 3D data set.

If the number of coordinates in the boxes is 2, the z coordinate is set by default alternatively to the 0 and 1 values, so that all the boxes have a depth of 1.0.

Example:

boxes {

{<42 1>
1 0
0 28
41 29
42 2 }
{ 4 28
3 3
14 2 }
}

The boxes do not have any particular property, but inherit from the class DVpick_components.

4.6 Cones

Name field:

cones

A set of cones is defined by a number of cones strings. Each point of a cone string must contain in principle 4 values, 3 for the center, and the fourth for the radius. For each string, each two adjacent cone points define a cone with orientation along the line passing by the two centers.

The body of the set of cones can contain nothing, in which case the cones are set by default to 1 cone string containing 1 cone defined by the centers:

0.0, 0.0, 0.0, 1.0
1.0, 0.0, 0.0, 1.0

As the two points define the same radius, the default cone is a cylinder.

If the set of cones is defined by the user, then the first element of the cones object body must be a 3D data set. We remind you that if each point has more than 3 coordinates, which is normally the case for a cone object, then the first point in the 3D data set must be enclosed by < and > .

By default the fourth coordinate represents the radius. If you want to use another coordinate for the radius, you can add, anywhere after the data section, the following specific property:

ray {column_number}

Note that the column numbers start from 0. In the example below, the column number 4 is actually the fifth column.

Example:

cones {
<0 0 0 1 1>
1 0 0 2 0.5
2 0 0 3 1
3 0 0 4 0.5
ray {4}
}

The cones class inherits from the class DVpick_components.

4.7 Set of framed lines with multiple ribbons

Name field:

frlines

A set of framed lines with multiple ribbons is defined by some 3D data followed by the set properties, and, at last, by some general object properties, and each of them is independently optional.

The points data is a 3D data set. If no information is present, a default line is constructed:

0 0 0 -> 1 0 0.

Each 2D data set represents a string of lines, and several of them can be present in one lines object.

The properties of the set of framed lines can be the cylinder and any number of ribbon properties.

The width property applies to the framed lines in the following manner:

Example:

frlines {

<19 0.895419 -0.527986 0.95 0.95 0.895419 -0.527986 0.95 0.95 0.95 -0.0920471 -0.715969 0.95 0.95 0.95 0.95 0.95>
20 0.890337 -0.601784 1 1 0.890337 -0.601784 1 1 1 0.000252651 -0.76089 1 1 1 1 1
xyz {1 2 3}
ccoord {4}
width {0.5 1}
ribbon { 5 6 7 8 }
ribbon { 9 10 11 12 }
ribbon { 13 14 15 16 }
ribbon { asymetric }
ribbon { vector_field }
}

The framed lines class also inherits from the DVpick_components class.

4.8 Set of lines, ribbons or cylinders

Name field:

lines

A set of lines, ribbons or cylinder is defined by some points data followed by the set properties, and, at last, by some general object properties, and each of them is independently optional.

The points data is a 3D data set. If no information is present, a default line is constructed:

0 0 0 -> 1 0 0.

Each 2D data set represents a string of lines, and several of them can be present in one lines object.

The properties of the set of lines can be : the cylinder, and the ribbon property.

Example:

lines {

<1 0 0 1 1 1>
1.5 0 0 1 1 1
2 0 0 1 1 1
cylinder
ribbon {3 4 5}
}

See the width section for its application to lines. The lines class also inherits from the DVpick_components class.

4.9 Set of points

Name field:

points

This class defines a list of simple points. If the body of the object is empty, the default points object will contain the origin point (0, 0, 0). The data in the points object is two dimensional. They are drawn as simple OpenGL points, whose number of pixels can be defined by the width property. The points class also inherits its properties from the DVpick_components class.

Example:

points {

<0 1 0 0>
0.01 0.972464378 0.185507501 0.025
0.02 0.911180956 0.360762062 0.05
width {3}
}

4.10 Set of polygons

Name field:

poly

The set of polygons can be set by default ( an empty body :{ } ) or be specified by a list of nodes ( at least 3) , which can be followed by the norms keyword and by a list of norms.

Each of the 2 lists is a 3D data set. The norms data must have the same structure as the nodes data: the number 2D data subsets must be the same, and each 2D data subset must have the same number of points as the nodes data, but the number of coordinates by point must be 3.

The default set of polygons is the same as the default triangle.

Example:

poly {

{ -6 1 -3
-6 1 2
0 1 6
6 1 2
6 1 -3
0 1 -6 }
{ -4 5 -3
-4 5 2
0 5 4
4 5 2
4 5 -3
0 5 -4 }
color { 1 1 0 }
}

As explained in the beginning, the information concerning the nodes and norms of the set of polygons can be followed by any number of properties. The set of polygons also inherits from the DVpick_components class.

4.11 Rotation surface

Name field:

rsurface

A rotation surface is described by a 2D data set representing a line that will be rotated around the Oz axis. The line is supposed to be in the xOz plane, and if it isn't, only the x and z coordinates will be considered for the rotation. The 2D data set can be followed by the angle keyword and by the rotation angle.

Example:

rsurf {

<0 0 5> <1.2 0 5> <1.3 0 5.1> <1.3 0 5.4>
<1.2 0 5.5> <0 0 5.5>
angle 360
color { 0.3 0.18 0.1 }
xyz { 0 2 1 }
translate { 5.5 0 0 }
}

Note: The rotation surface points are calculated immediately after the information about the angle. Any property that is given afterwards does not affect the construction of the surface, but only the way it is drawn. If you want a different precision in the number of steps for the rotation, you should include the rotation surface in a node object, and set its geometric complexity before declaring the rotation surface. This doesn't work yet very well, but I'll check on it as soon as possible.

The rotation surface is derived from the triangle strips class, and so is also a subclass of DVpick_components.

4.12 Set of spheres

Name field:

spheres

A set of spheres is defined by a number of centers followed by a ray, and each of them is independently optional.

Each center is defined by 3 real values ( its coordinates) . If no center information is present, the set of spheres will contain one default sphere with the center:

0.0, 0.0, 0.0

If the ray information is not present, the default ray is 1.0. The ray applies to all the spheres in the set.

Example:

spheres {

1 0 0
1.5 0 0
2 0 0
ray {0.5}
}

As explained in the beginning, the information concerning the centers and the ray of the set of spheres can be followed by any number of properties. The spheres class inherits from the DVpick_components class.

4.13 Surface

Node field:

surface

A surface corresponding to the DVsurface class is a complex object that needs several field in its description. So, the body of a surface must contain the following information: the point numbers, the points data, the norms data, the patches size, and the point numbers in each patch. The surface body can be empty, in which case the surface will contain nothing ( sorry, I was lazy on this part) . From all the items of the surface, only the norms data is optional. All the other items either do not appear at all, either they must all be given.

Point numbers

The point numbers can be implicit or explicit.

The implicit point numbers are given only by their number, are are set by default to 0...number.

The explicit point number must be given one by one in an increasing order. To distinguish them from the implicit form, they must be enclosed in curly braces { } . If the numbers are not in order, the unordered part will be replaced by a default sequence. For example, the list of point numbers:

{ 1 3 4 6 7 0 0 0}

will be replaces by

{ 1 3 4 6 7 8 9 10}

Each number in this list corresponds to the point data with the same index (and not the same number !). For example, in the list above, the number '4' denotes the 3rd point in the point data list.

Points data

This part of the surface is a simple 2D data list, with the only difference that is enclosed by curly braces. Only one string of points is admitted here. This data will not be repeated afterwards, but will be accessed by the point numbers.

Norms data

This is the only optional item of the surface. If it is present, it must be preceded by the token norms and has the same as the points data: a 2D data list enclosed in curly braces. Note that if the norms are given, the surface will be smooth.

Patch sizes

This is a list of simple integer numbers enclosed in curly braces. The surface is composed of a number of patches, each being a polygon. Each number in this list represent the number of points in a patch.

Patch points

This is a special 2D data list, in which each point has its own length ( number of coordinates) . The numbers in this list are integers and each of them must also be found in the point numbers list. Each such list of integers must be sized according to the size of the patch defined in the previous item.

Specific properties

The surface has only one specific property, which specifies if the surface is smooth or not and only need the token smooth with no other argument. If the norms data is explicitly given, then this property has no effect.

The class DVsurface is also derived from the DVpick_components class and inherits its properties.

Example:

surface {

12
{<-6 1 -3 0>
-6 1 2 1
0 1 6 2
6 1 2 3
6 1 -3 4
0 1 -6 5
-4 5 -3 6
-4 5 2 7
0 5 4 8
4 5 2 9
4 5 -3 10
0 5 -4 11 }
{ 6 6 4 }
{< 0 1 2 3 4 5 >
< 6 7 8 9 10 11 >
< 0 1 7 6> }
smooth
}

4.14 Texture quadrilateral

Name field:

texture

The texture quadrilateral is defined by 4 points with 3 coordinates each, and a file name containing a ppm image. If the 4 points are not specified, the default quadrilateral is set to:

<-1.0 -1.0 0.0 >
< 1.0 -1.0 0.0 >
< 1.0 1.0 0.0 >
<-1.0 1.0 0.0 >

The ppm image must be in a ascii rgb ppm . The width and height of the image must both be a power of 2 (like 256 / 1024), but the image does not have to be a square. Images of less that 64 / 64 pixels can cause problems.

If the proportion of the image is different than that of the quadrilater, the image will be scaled to fit in the quadrilateral.

Example:

texture {

-4.0 4.0 0.0
-4.0 -4.0 0.0
4.0 -4.0 0.0
4.0 4.0 0.0
Moto.ppm
}

The DVtexture_quadrilateral class can only have simple properties.

4.15 Triangle

Name field:

triangle

The triangle can be set by default (an empty body : { } ) or be specified by the three nodes, by a norm or by 3 norms. According to this the body of the triangle can contain:

Example:

triangle {

0.0 0.0 0.0
1.0 0.0 0.0
0.0 1.0 0.0
}

As explained in the beginning, the information concerning the nodes and norms of the triangle can be followed by any number of properties.

4.16 Triangle grid

Name field:

tgrid

The triangle grid can be set by default (an empty body : {} ) or be specified by a list of nodes (at least 3), which can be followed by the norms keyword and by a list of norms.

Each of the 2 lists is a 3D data set. The norms data must have the same structure as the nodes data: the number 2D data subsets must be the same, and each 2D data subset must have the same number of points as the nodes data, but each points must have 3 coordinates.

The difference from the triangle strip is that the points must be rectangular, which means that each 2D data set in the triangle grid must have the same number of points.

The default triangle grid (corresponding to no data in the body) is:

{ 0 0 0
0 0 1 }
{ 0 1 0
0 1 1 }

Example:

tgrid {

{ 0 1 0
0 2 0
0 3 0 }
{ 1 1 0
2 2 0
3 3 0 }
{ 2 1 1
4 2 2
5 3 3 }
color { 1 0 0 }
}

As explained in the beginning, the information concerning the nodes and norms of the triangle grid can be followed by any number of properties. The triangle grid also inherits from the DVpick_components class.

4.17 Triangle strip

Name field:

tstrip

The triangle strip can be set by default (an empty body :{ } ) or be specified by a list of nodes (at least 3), which can be followed by the norms keyword and by a list of norms.

Each of the 2 lists is a 3D data set. The norms data must have the same structure as the nodes data: the number 2D data subsets must be the same, and each 2D data subset must have the same number of points as the nodes data.

The default triangle grid is the same as the default triangle.

Example:

tstrip {

0.0 0.0 0.0
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
0.0 0.0 0.0
1.0 0.0 0.0
}

This triangle strip builds a tetrahedron.

As explained in the beginning, the information concerning the nodes and norms of the triangle strip can be followed by any number of properties. The triangle strip also inherits from the DVpick_components class.

The triangle strip has only one special property, defined by the keyword "fan". This causes the list of points to be drawn as a triangle fan, in which each two points in the sequence, except for the first one, compose a triangle with the very first point in the sequence.

Example:

tstrip {

{0.0 0.0 0.0
1.0 1.0 1.0
-1.0 1.0 1.0
-1.0 -1.0 1.0
1.0 -1.0 1.0
1.0 1.0 1.0}
{1.0 1.0 1.0
-1.0 1.0 1.0
-1.0 -1.0 1.0
1.0 -1.0 1.0}
fan
}

This triangle fan builds a pyramid.


Next Previous Contents