View Single Post
# 4 06-02-2006 , 02:38 AM
MattTheMan's Avatar
Registered User
Join Date: Apr 2005
Location: Fairfield, CT
Posts: 2,436
You know, I took a better look at that code, and found that using vectors as edges is a very bad thing to do.

Vectors being lines in 3d space starting at point O and going on in a constant direction forever, unless affected by some other object.

My method included using only parts of vectors as edges, and that took a bunch of code.

Simply using vertices (3 floating point numbers: x, y, and z) like this:

class vertex{
Public:
float x, y, z;
};

and triangular faces like this:

class tri{
Public:
float vertex(x, y, z), vertex(x, y, z), vertex(x, y, z);
};

and finally, the entire polygon like this:

class poly{
Public:
float tri(vertex(x, y, z)), vertex(x, y, z)), vertex(x, y, z)), tri(vertex(x, y, z))
};

allows me to edit polygons really easily.

by the way, that last one is a plane

and then I can have an array of polygons making up the entire scene.

This also makes it easier for me to do some collision testing, like for split faces tool and stuff. ALso makes booleans a breeze. In the end, this will help me make a .obj or .3ds exporter for my raytracer.

cya later,
Matt user added image


Live the life you love, love the life you live