Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Extrusion of edges algorithm in c++ (https://simplymaya.com/forum/showthread.php?t=20072)

MattTheMan 30-01-2006 02:06 AM

Extrusion of edges algorithm in c++
 
1 Attachment(s)
Alright, people, another issue here.
To make a modeling system using poly by poly technique, first, I create a plane: 2 vectors with a projection between them.
and then I have this issue: Two sides are vectors, but the other two are not. Is there any way I can convert those 2 sides to vectors so I can manipulate them?

heres a little diagram I drew in Paint (i didnt feel like starting up photoshop) to help you understand my problem.

Joopson 30-01-2006 02:52 AM

umm,,,... soryy, i d k, im lost :)

MattTheMan 05-02-2006 06:21 PM

1 Attachment(s)
Ok, I figured it out. This is sooo obvious now. Instead of just having 2 vectors per quad, now I have 5.

It has 2 vectors sharing each vertex, so I can extrude on all sides, plus I can manipulate each vertice, and it will affect the opposite end as well, (when I tried this on my old program, it crashed) because it is triangulated. Though, I don't have to display the triangulating edge, the computer knows its still there.

MattTheMan 06-02-2006 02:38 AM

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 :alien:

gster123 06-02-2006 06:31 PM

Your doin well on the old programming mate!!

What you using to do it with??

I did 2 years of C++ programming then gave it up, couldent get my head round it, thinbk I'm gonna have to get back into it tho!!

MattTheMan 06-02-2006 09:54 PM

Yah, I need sum1 to help me >.< lol just kidding. I still need to get some stuff done on my raytracer, I'm working on the scene building code now.

Im using Bloodshed Dev C++ 5.0 beta for my compiler: its free and its considered one of the best c++ compilers out there

I think everyone should know some programming, at least everyone in the comp industry. I do it for fun, but I might want to be a programmer for a career.

cya later,
Matt :alien:


All times are GMT. The time now is 08:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018