<- previous index next ->
Rendering a static scene with lighting and shading is a complex program. I have written one as have some of you. The basic input is a 3D model. A 3D model must have coordinates of vertices. The model may have lines, polygons and more complex shapes and imported objects. There may be colors, lighting and texture mapping. A number of programs are available to allow a person to create or enter a model. There are many formats for 3D models. I have shown the Utah Graphics .dat (ASCII) and .det (binary) files that have vertices and polygons. There is also .stl and UCD .inp that have key words and syntax (ASCII) and there are many more formats. cube.dat cube2.stl ucd1.inp One primitive scene input, to a renderer named "run6" looks like lab6_input1 The model is your "world" that is to be rendered. The world does not move, the point of view, your eye, moves. ------------------- OpenGL is a 3D rendering system. It uses what is called a "rendering pipeline" to present the 3D modeled scene as a 2D image on the computer screen. Graphics cards may have some to very sophisticated rendering built into hardware and software. Your 3D world model may use only triangles to represent the surface of objects. Triangles are convenient for renderers because the three points that define the triangle exactly define a plane. Everywhere on that plane has the same normal vector that is needed in computing the lighting. Use of quadrilaterals and higher order polygons, may not be planar. Thus, every point on the surface may have a unique normal vector, that must be computed, to determine the lighting. Covered in the textbook, Chapter 12, is Advanced Rendering. This covers ray tracing and other advanced techniques. For download of a ray trace renderer, the one I like best is www.povray.org and www.povray.org/download Available for MS Windows, Linux, MacOS in both binary and source. Example outputs: features scene description For shadows, light through glass, rainbow effects, it is best to use a ray casting renderer. For very complex geometries without the above effects, a Z-Plane renderer may be best. For example, OpenGL can do shadows, yet they are difficult. The next level of complexity and sophistication is rendering animation. This is typically done off line by massive computing power. We have seen some trailers of some 3D cartoon movies. Technical activities also need animation. Dynamic rendering, international space station assembly A different animation than shown previously. matlab sample plots helix.m source code hump.m source code hump_m.out plot data hump2.m source code hump2_m.out plot data hump3.m source code hump3_m.out plot data surfplot.m source code surfplot_m.out plot data shape22.m source code shape22_m.out plot data See Google Sketchup for 3D object and scene input. Cartoons and games are rendering every frame. Special techniques are used to obtain the required frame rates. Each frame must be rendered or at a minimum, the pixels that change must be rendered. We have java programs to display .dat and .stl files in 3D light_dat.java light_dat1.java rotated hump2.dat light_normal.java datread.java light_stl.java light_normal_stl.java heapsort.java Think outside the cube. Consider the fourth dimension, not time. Is the video consistent? tetraspace.alkaline.org forward link to 4D in lecture 21 time to do HW5 To make 3D physical objects, render 2D and cut out. Leave tabs when cutting, if you are going to glue together. dodecahedron.java The regular polyhedra have vertex on a sphere: dodecahedron.py3 source code icosahedron.py3 source code tetrahedron.py3 source code cube.py3 source code octahedron.dat no source code needed Example of another hump, 2D, 3D, then scale and make .stl humpc.java source code humpc_java.out output humpc2.dat 2D with lines humpc.dat 3D with triangles humpcc.dat rotated and with colors in light_dat.java humpc30.stl scaled .stl
<- previous index next ->
Many web sites on Java GUI, AWT, Swing, etc. Many web sites on Python wx, tk, qt, etc.