<left> [Contents | Tutorials ]

### Lesson 4: Editing Primitives

Editing primitives is a major bulk of the model creating process, here we will show some basic editing capabilities and then some techniques. First we will focus on editing primitives that are drawn.

Primitives that are drawn have vertex data, a vertex is a set of 3D coordinate points accompanied by a normal vector and a texture anchor point(often reffered to as a texcoord). The actual 3D coordinate is in space relative to the last matrix level specified by a translate or rotate primitive (or the identity matrix if there are no translate or rotate primitive grouping the primitive in question). The normal vector is for lighting and the texcure anchor point (texcoord) is for texturing (both discussed later).

Managing vertices on each drawn primitive is important, some of these primitives allow you to modify the number of vertices it has and some do not. The following are primitives that are drawn but have a fixed number of verticies:

- Point (1 vertex)
- Line (2 vertices)
- Triangle (3 vertices)
- Quad (4 verticies)

All of the above primitives have a fixed number of verticies which you can neither remove from nor add to. However you can add or remove vertices with the following primitive types:

- Line Strip
- Line Loop
- Triangle Strip
- Triangle Fan
- Quad Strip
- Polygon

The basic way to add a vertex to any of the above primitive types is to select the primitive (more details on selecting primitives farther below), first select a model then select a drawn primitive. Note that the values list on the right most pane is updated. It lists all the vertices that this primitive has. From there you can insert or remove a vertex by going to Primitives->Add Vertex or Primitives->Remove Vertex (respectivly).

There are two ways to change the value of a vertex, the first way is to change it literally by selecting the vertex on the values list on the right pane and then modifying its values which appear on the prompts just below the list (as shown on the right).

The prompts X: Y: and Z: specify the values for the vertex's location in 3D space relative to the last matrix level. While NX: NY: and NZ: specify the normal vector (need not be in unitlized form unless the intended use specifies so). Lastly the TX: and TY: specify the texture anchor point (texcoord), note that TZ: is ignored as it is reserved.

Remember to press ENTER or the Apply button before selecting something else to make sure that your modified values are processed. Remember that you can always Undo or Redo any modifications to vertex data.

The second way to modify a vertex's position is to simply select the vertex and then click Button2 on one of the 2D views at the desired location. You can also move the entire primitive by selecting the primitive but none of its vertices, then press and drag with Button2 on any of the 2D views.

The 2D views always represent the identity matrix level of relativity regardless if there exist translation or rotation primitives.

Selecting primitives is also another important part of editing, you can always select a primitive from the primitives list however the browsing time may become extremely tedious. Another way of selecting is to hold down the SHIFT key and Button1 while dragging over one of the 2D views, a bounding box will appear indicating the selecting region... release Button1 when you satisfied with the region you specified. Any vertices (not lines or solid regions) that are found in the bounding box will be considered matched. If more than one vertex is matched then a dialog will appear prompting if you want to select this vertex or go on to the next matched vertex. Ultimatly you can only select one primitive with one vertex with this operation, if you want to select a group of primitives then you will need to do that by holding the CTRL or SHIFT key and select from the primitives list (reffer to your GUI manual about multiple list row selecting).

Mass operations on selected primitive(s) is another important feature, because editing a vertex one by one is awefully tedious (espessially if you want to modify a number of them by one identical relative apsect such as scaling). Look under the Primitives menu and you will see procedures for unitlizing normals to mirroring a group of primitives. You should take a moment to experiment with these features before continuing (consult a trig book if you are unfamiliar with any of those terms), also note that most of these operations depend on the current cursor position. As mentioned earlier the current cursor position is marked by a cross on the 2D views, you can move this cursor by simply pressing Button1 at the desired location on the 2D view.

Once you've had a through taste of the mass operation commands, its time to move on to editing other types of primitives. These primitives include the following types:

- Comment
- Translate/Untranslate
- Rotate/Unrotate
- Color
- Texture select
- Texture orient
- Texture unselect
- Heightfield

You may encounter the Comment primitive quite often, the Comment primitive contains a block of text that is stored as a comment or third party data that this program cannot understand. When you select a comment primitive, the text box (long horizontal pane just above the status bar) will display its entire contents. You can modify a comment prmitive's contents but BE CAREFUL NOT TO SPECIFY ANY LINES THAT MAY BE CONFUSED AS V3D DATA (such as "color my cat" which may be interprited as a color primitive on the next load. This is useful if you want to insert third party data within a standard V3D model. Otherwise you can just use it as a comment (starting each line with a # character).

Translate/untranslate and Rotate/unrotate primitives are similar to vertex data and are edited on the values list when selected. The untranslate and unrotate primitives do not contain any data (they just pop one matrix introduced by a prior translate or rotate primitive). You can edit the translate and rotate primitive values similarly on the values list but they are not editable on the 2D views.

Color and texture select primitives can be edited by simply double clicking on them in the primitives list.

Texture orient primitives can be edited on either the values list or on the 2D views. The size of the texture orient deltas can only be edited on the values list though.

Texture unselect undoes the prior texture select primitive's effect.

Heightfields are rather complex and should be reserved for more advanced discussion.

Next Lesson: Editing the Header

######

Back to the top

Vertex is Copyright © 2000-2001 WolfPack Entertainment

</left>