Day 3 - Modeling & OBJ Format

A little more modeling

Two types of objects

  • Made by man

    • Specific dimensions
    • Straight lines
    • Right angles
    • Uniform duplicates
  • Made by nature

    • Random
    • Fractals
    • Curves
    • Non-uniform duplicates

As a result of these differences, modeling organic things requires different techniques.

Organic modeling ideas

  • Proportional editing
  • Subdivision Surfaces
  • Sculpting

Computer Graphics History Moment

Ed Catmull created what is now called subdivision surfaces in Blender, among other very influential accomplishments.

Professional Tools

No ones really uses Blender in commercial products, but licensing prevents us from installing professional tools on university computers 😦

All of these tools have free student editions. If you are serious about a career in the electron arts, I'd consider learning these tools.

Generating Models from Code

The most universal way to generate models from code is to create a file that represents a model and then import that into what ever software you are using.

There are several model format available. To understand what is available, think about the formats available when you write a document.

Compare to text documents

.txt .docx
Open Proprietary
Simple Complex
Limited Expressive

In terms of files that represent 3D models, two common file formats are .obj and .fbx.

.obj .fbx
Open Proprietary
Simple Complex
Limited Expressive

Due to its openness and simplicity, we will generate .obj files is this class. Note that when you export models from one program to import into another program, you probably want to use the .fbx format since it is a more expressive format.

OBJ format

Every line is its own entry 2 kinds of entries for now

  • Vertices are defined on lines that start with the character v
    • v 0 0 0 (defines a vertex at x,y,z coordinates 0,0,0)
  • Faces (triangles, etc.) are defined on lines that start with the character f
    • f 1,2,3 (defines a face with the first, second, and third vertices defined in the file)

Example OBJ file

v 0 0 0
v 1 0 0 
v 0 1 0
f 1 2 3

python code

We can generate a simple obj file representing the above triangle with the following python code:

https://github.com/4620/code/blob/master/Day3-OBJGenerator.py