Task 122: Defining a 3D Scene via Lines (wireframe modelling)

Your task is to construct a 3D scene that consists only of lines. At your disposal is a template application that offers a B-rep surface model: these can also only contain lines, which is how we will use it now. The application can already render such a scene, and the scene can be rotated interactively with the Trackball system.

Screenshot

Overview

The template application 086shaders from the repository grcis serves as the basis of this project. This is a ready to use application that can render a 3D scene that can be viewed via the "trackball" control system. It can also load a 3D scene from a file (Wavefront OBJ), or generate it procedurally via code you supply. This is then rendered using the GPU, and the resulting image can be saved to disk.
To construct a scene procedurally, you will need to modify the provided Construction class defined in the Construction.lines.cs source file. The procedural content generation method is called Construction.AddMesh(). You do not need to set any shading attributes: you can't define meaningful normal vectors for lines anyway. You need to take the the transformation matrix m into account, which you need to transform all inserted vertices (Vector3.TransformPosition()) and any normal vertices (Vector3.TransformVector()).

Ideas

For starters, you could consider doing a 3D version of whatever you did for assignment 092.
One possibility is a nice spatial curve (but please not the generalised Lissajous curve from the pilot implementation). We prefer nice curves that can be modified using text parameters. An example of an acceptable generalisation are 3D variants of the so-called Rose curves. Using such a curve requires that you come up with some interesting function for the third dimension.

Technical details

You create an object SceneBrep, to which you can add lines and vertices, for which you can set transformation matrices Matrix4 and text parameters for the procedural construction (e.g. curve parameters, or such).
Note that your function Construction.AddMesh() can be invoked repeatedly.

Construction Methods

  • add vertices via SceneBrep.AddVertex(). Don't forget to transfer them with the correct matrix beforehand! (e.g. Vector3.TransformPosition())
  • set vertex colours via SceneBrep.SetColor(). The range of RGB coordinates is [0.0, 1.0]
  • texture coordinates for a vertex can be set via SceneBrep.SetTxtCoord(). Their range is [0.0, 1.0]. (note that these are not needed for wireframe models)
  • Use SceneBrep.AddLine(i,j) to add lines. Use the indices of previously created vertices for this (the return value of SceneBrep.AddVertex())

Deadline

Hand in until: 12. 1. 2020

Points

Basis: 6 points (implementation of some own idea or some non-trivial curve according to literature).
Bonus up to 6 points for inventiveness, nice colouring, aesthetics, etc.

Project

Visual Studio project: 086shader.

Source file

Modify and hand in the source file: Construction.line.cs .
Don't forget to put your name in InitParams()!


Copyright (C) 2015 J. Pelikán & A. Wilkie, last change: 2019-12-10 07:48:58 +0100 (Tue, 10 Dec 2019)