Home

hws.edu-examples/basic-object-models-with-tangents-IFS.js

Summary.

The functions in this file create models in an IFS (Indexed Face Set) format that can be drawn using gl.drawElements with primitive type gl.TRIANGLES.

Objects have for each vertex:
  • vertex coordinates,
  • normal vectors,
  • texture coordinates,
  • vertex tangents,
  • plus a list of indices for the element array buffer.
The return value of each function is an object, model, with properties:
   model.vertexPositions -- the vertex coordinates;
   model.vertexNormals -- the normal vectors;
   model.vertexTextureCoords -- the texture coordinates;
   model.vertexTangents -- the tangent vectors;
   model.indices -- the face indices.
The first four properties are of type Float32Array, while model.indices is of type Uint16Array.
Since:
  • 19/11/2022
Author:
  • David J. Eck and modified by Paulo Roma
Source:
See:

hws.edu-examples/bumpmap.js

Summary.

Bump Mapping.

A mostly successful attempt to do bumpmapping.
Grayscale height maps are used to perturb the normals to a surface, making the surface look "bumpy".
The implementation requires tangent vectors for the surface.

The three object models used here have tangent vectors that can be passed as an attribute to the shader program.

Note: I haven't learned how to make the appropriate tangent vectors in general.
It took some experimentation for me to get them pointed in directions that seem to work.
Since:
  • 19/11/2022
Author:
  • David J. Eck and modified by Paulo Roma
Source:
See:

hws.edu-examples/trackball-rotator.js

Summary.

The TrackballRotator class implements an ArcBall like interface.

Create by Ken Shoemake in 1992, it is the de facto standard for interactive 3D model manipulation and visualization.

The class defines the following methods for an object rotator of type TrackballRotator:

Since:
  • 19/11/2022
Author:
  • David J. Eck and modified by Paulo Roma
Source:
See:

lib/gl-matrix/dist/esm/common.js

Summary.

High performance matrix and vector operations.

Version:
  • 3.4.0
Author:
  • Brandon Jones
  • Colin MacKenzie IV
Source:
See: