Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Learning Math For 3D Programming

Name: Anonymous 2011-09-02 15:40

Using this book: http://www.amazon.com/Mathematics-Programming-Computer-Graphics-Third/dp/1435458869

I'm trying to learn so that I can write a simple ray tracer. Once I've done that, I want to write a path tracer and then implement metropolis light transport as a semester project for a class.

The only problem is I've never done any kind of graphics programming before, so I have no idea if my craptop is going to be a huge problem. It has integrated graphics and an intel core 2 with 2 cores running at 1.66ghz. I figure that this will be fine because ray tracing is more dependent on the CPU than the GPU, isn't it?

Just don't want to put in the work and then have to buy a new computer, I'm fucking broke.

Also, how feasible is it to do this in C#? My class is titled "Computer Graphics", but it is taught by a CIS professor, and there are 9 CS students and over 20 CIS students in the class, so it covers precisely nothing that one would expect to find in a CG class, and is really just an introduction to C# and XNA, with a semester long C# project to go with it. The entire first month is going to be spent on fucking C# syntax and collections in a 4000-level class.

I need something cool to do graphics-wise in C# here. I don't want to write a shitty space shooter. I can't even install XNA on my computer, anyway, as it doesn't support shaders, so I have to borrow a computer for the XNA assignments. If a cool ray tracer isn't feasible, what is?

Name: Anonymous 2011-09-02 21:54

Ray tracing is easily feasible, language doesn't matter unless you are wanting to implement intensive features (global illumination, super sampling etc). Path tracing is a bit harder and not as well understood.

Almost nothing will be done on the GPU unless you write for the GPU yourself (don't, anything you could write within a year or two will render in under 30 seconds anyway).

Step 1: Write Vector3f class. Scalar multiplication, dot product, cross product, normalization, addition, subtraction, negation, modulation, saturation, length, and distance functions go in here.

Step 2: Write simple Ray3f class. A ray is just two Vector3f's, (point and direction).

Step 3: Create simple object. Each object needs a getNormal function which takes a point and returns the object normal at that point, along with an intersection function which takes a ray and returns the point of intersection, if it exists. A sphere is probably easiest to get up and running.

Step 4: Write camera. This gets created with some view parameters (fov, width, height, eye point, look at vector, up vector (usually 0,1,0)). Has a getPixelColor function which creates a ray from the eye point through that pixel on the image, and then intersects it with all objects (spheres) in the scene with a depth buffer to get the color. You can now create images.

Step 5: Optionally, implement lighting (could be simple models like Phong, or advanced BRDF, radiosity, photon mapping etc), AA, more objects, texturing, CSG, reflection, refraction, shadows, caustics, dof, and so on.

Name: Anonymous 2011-09-03 20:01

>>4
Now that I'm writing a Vector3f class, I'm wondering if it wouldn't be better to just use 4D vectors? e.g., <x,y,z,w>, where w=0 implies that the vector is a direction, and w=1 implies that the vector is a point, for easier transforms.

Is this worth doing at this point? Or should I not worry about it since I won't be making anything move, as my goal is to make pretty pictures and not a real-time renderer?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List