03-31-2004, 01:21 AM
I have never been that good at 3D, but i recently decided to give it another try. It works like this,
TYPE 3DPoint
X AS INTEGER
Y AS INTEGER
Z AS INTEGER
END TYPE
DIM SHARED Plane(99, 3) AS 3DPoint
This gives me 100 little planes that I can do whatever I want with! Each plane is made up of 4 points, and I just draw a line between them. It looks really good in wireframe, and I have some nice 3D models that I made... But wire frame isn't as good as gouraud shading!!
Now first, I want to say that I'm using DQB... I'm comfortable with DQB, and when I'm done with a program, if it isn't fast enough, then I convert it to a different lib. Here is my problem:
1) I need a way to find the center of each plane. the problem with that is sometimes they are, for lack of a better word, bent. What my ultimate goal is, is to do this:
I wan't to have 4 gouraud shaded triangles per plane, intersecting at the middle. but sometimes the planes are stretched into wierd shapes, so I don't know how to determine the X, Y, Z coordinates of the center of the plane.
my second problem is this:
FOR P = 0 TO PLANES - 1
DrawPlane P
NEXT
that's not the actual code, but its something like that... In wire frame, that looks fine, but when I have it filled, sometimes the polygons that are closest are filled first, depending on how the object is rotated. What would I need to do to set it so that the closest planes get drawn last?
This is a little demo of my wireframe 3D capabilities...
REMEMBER, TURN EMS ON!
http://www.geocities.com/remixer1989/zonewar3d.zip
right click -> save as
(btw, I know that I should set it so that it only as 3 points per plane, but its not compatible with the software I use to create the models so I can't)
TYPE 3DPoint
X AS INTEGER
Y AS INTEGER
Z AS INTEGER
END TYPE
DIM SHARED Plane(99, 3) AS 3DPoint
This gives me 100 little planes that I can do whatever I want with! Each plane is made up of 4 points, and I just draw a line between them. It looks really good in wireframe, and I have some nice 3D models that I made... But wire frame isn't as good as gouraud shading!!
Now first, I want to say that I'm using DQB... I'm comfortable with DQB, and when I'm done with a program, if it isn't fast enough, then I convert it to a different lib. Here is my problem:
1) I need a way to find the center of each plane. the problem with that is sometimes they are, for lack of a better word, bent. What my ultimate goal is, is to do this:
Code:
+-------------------------+
| `. ,'|
| `. ,' |
| `. _,' |
| `. ,' |
| `. ,' |
| ><' |
| ,' `-. |
| ,' `. |
| ,,' `. |
| ,;' `. |
|.' `. |
+-------------------------+
I wan't to have 4 gouraud shaded triangles per plane, intersecting at the middle. but sometimes the planes are stretched into wierd shapes, so I don't know how to determine the X, Y, Z coordinates of the center of the plane.
my second problem is this:
FOR P = 0 TO PLANES - 1
DrawPlane P
NEXT
that's not the actual code, but its something like that... In wire frame, that looks fine, but when I have it filled, sometimes the polygons that are closest are filled first, depending on how the object is rotated. What would I need to do to set it so that the closest planes get drawn last?
This is a little demo of my wireframe 3D capabilities...
REMEMBER, TURN EMS ON!
http://www.geocities.com/remixer1989/zonewar3d.zip
right click -> save as
(btw, I know that I should set it so that it only as 3 points per plane, but its not compatible with the software I use to create the models so I can't)