Page 1 of 1

Simple 3D Rendering World

Posted: Wed Jan 05, 2011 12:53 am
by Team Xlink
I'm trying to come up with a basic 3D rendering world, in a simple system that could be implemented in most languages that supports drawing something on screen.

There would be a 3D grid, it would have X, Y, and Z cordinates.

Image

The program would read from a file that would include the cordinates, it could be setup as a matrix, but for now something like this:

Code: Select all

A1 = X, Y, Z
A2 = X, Y, Z
A3 = X, Y, Z
A4 = X, Y, Z
That would create an outline of a plane, or 2D object with four sides. The A represents the group or object they belong too while, the number represents the instance of the object. Each instance counts as a side. This is a simple system that could be reworked to provide larger range of possibilities.

Here are more examples

Triangle

Code: Select all

A1 = X, Y, Z
A2 = X, Y, Z
A3 = X, Y, Z
Pentigon

Code: Select all

A1 = X, Y, Z
A2 = X, Y, Z
A3 = X, Y, Z
A4 = X, Y, Z
A5 = X, Y, Z
Hexagon

Code: Select all

A1 = X, Y, Z
A2 = X, Y, Z
A3 = X, Y, Z
A4 = X, Y, Z
A5 = X, Y, Z
A6 = X, Y, Z
You could then render the area inside the outline a color, thereby differentiating itself from the other planes in the world.

This is the general idea of the system. It is simple, however because of the simple conecpt this is, it introduces a number of flaws.

What if they you made a set of points and attempted to render the area inside it, a color. Like this:

Code: Select all

A1 = X, Y, Z
A2 = X, Y, Z
This does not make a plane, and could produce a number of events, of which the most desirable, being an automatic shutdown of the process.

If the process was not ended, it could potentially attempt to render the whole grid in a color, if there isn't a limit on the size of the grid, then it would have a memory leak, causing undesirable events.

What do you think?

EDIT: I forgot to include the image, and unfortunately, when I resized it it got really bad, and MSPaint doesn't offer very many undue options/

Posted: Wed Jan 05, 2011 5:11 am
by andrewj
Why not just load OBJ format? It's simple text format and the article on Wikipedia explains it well.

Posted: Wed Jan 05, 2011 5:32 am
by Downsider
well whatever you're trying to accomplish, that little psuedoformat would be incredibly ease to parse and render, and other than that there's hundreds of more compact and easily parsed formats available to choose from..

Posted: Wed Jan 05, 2011 5:38 am
by leileilol
But OBJ is the best, the other little compact formats don't really matter. Ask around - everything that works can export into .OBJ.

The hard part is improvising some vis data, and not to mention making brush entities and pointcontents (water in laykid's terms)....