From: David S. <dsc...@vy...> - 2001-02-25 03:20:17
|
> An overview of the cvisual's rendering approach might help me get > started. I will help as I can. > Is there anything available that might help me better understand > cvisual at > this level? There is no technical documentation, sorry :( > What > I am seeing in the code, to the extent I follow it, is not what I would > expect. If I look > at the code for a glut sphere or cone I see it being built > geometrically from > triangle fans and strips. There are basically 3 kinds of code in Visual primitives (1) code to implement the Python interface (attributes + methods). We use the CXX library, which wraps C++ classes around Python types and vice-versa, to make this easier. (2) code to render the primitive (using triangle strips or other GL primitives). This will look a little like the implementations you are used to, but Visual cannot use OpenGL matrix math (it is too inaccurate when the scale of the scene is very large or small, which is important for physics). Therefore the code does transformation and lighting itself using the tmatrix class. (3) code to implement mouse picking. This is raytracing code. The line between the camera position and the mouse cursor forms a ray which is intersected with all objects in the scene. The closest intersection is taken to be mouse.pick/mouse.pickpos. > Cvisual seems to look more like ray-tracing code - which I have > never been able to follow - though wish I could. Actually, a simple raytracer is a relatively gentle introduction to graphics, if you find one written for pedagogical value rather than for efficiency. Maybe someone needs to write one in Python. Dave |