Re: A85: At the risk of losing you...
[Prev][Next][Index][Thread]
Re: A85: At the risk of losing you...
{{2 comments:
1. i don't see why you would only want to use 1 byte for the x,y,z
coordinates. i doubt that everything in the world that you are
creating would fit into such a small space.}}
I said that you can use 2 bytes if you wanted to, but 256 is a lot of
space (for me anyway). I've done a lot of 3d programming and the
viewing space can fit well within 256. I'm not saying use 256 as what
it is, for zooming keep the numbers the same, just change the formula.
I'll explain: if you wanted to have a huge 256x256x256 cube, don't put
points at 0,0,0 to 255,255,255...why not just do 0,0,0 to 1,1,1 and say
"zoom 256." This is used for multiple objects also, if you can find a
divisible number use it! And like I said before, you can always use
more than 1 byte, but if I were to do that I'd specify the byte size in
the header.
{{2. if he is only doing wire frame with no clipping of hidden lines, he
does not need to worry about the order of the points (i would think).
but from ordered points, you can determine if the face is towards the
viewer (draw it) or facing away from the viewer (don't draw it) by
calculating the normal.}}
But for adaptability with other versions and stuff, you should think
that you are using it with other programs. This is so you don't have to
rewrite the code, all you have to do is put as much information in it as
you can and specify the size. This way when another version comes out
it doesn't have to translate that much, and you can also add after the
end of the size marker the new data for the new version.
{{BTW, can anyone explain to me how to clip lines for a wireframe?}}
If I were doing it it would be in spherical. Everything between 180
degrees to 360 degrees wouldn't be drawn. This will cut anything that
is behind you out.
{{for
polygons its easy, just draw back to front, but for lines, how do you
determine if the line is going to be behind another object? you can't
just draw over a line with another line!?!?!?!}}
In wireframe you can see EVERYTHING. Meaning that you can see through
walls and around corners and everything. To actually make an object
"clear" the object behind it just update the version I gave.
for the second .db I had it store the lines, instead make it do p,1~
where p=polygon (a number to represent the points to draw the lines from
and to, and use wraparound) and 1~ is a list of the points. for
example, 3,1,2,3 would mean a triangle using the lines 1-2, 2-3, and
3-1. Use a blocked pattern on the face of it with the a 0 color and it
will erase everything behind the object (if you know how to fill a
polygon). Since I had specified to make the list of lines and
everything in order around the 3d-plane in clockwise fashion, it will
work fine, also use from back to front, top/bottom to middle while going
clockwise (meaning do the back topmost and bottommost clockwise, take a
step in and do it over...etc.)
{{for example, how would you draw the lower right corner of box 1 below
with a wireframe?
+----+[3]
/ /|
/ / |
+----+ |
| 1 | |
| | /
| +-----+
+--| 2 |
| |
| |
+-----+}}
This is explained above. As you go around the 3d plane clockwise you
would reach 3 first (since it is further back from the rest going
clockwise), then it would reach 1, then 2...1 will erase 3 and 2 will
erase 1. In wireframe though, this is what would be shown:
+----+
/| /|
/ | / |
+--+-+ |
| 1+-|--+
| / | /
|/ +-++--+
+--+-+ 2 |
| |
| |
+-----+
{{-mike pearce}}
-Rob
ICQ:9188921 "No Sol to kill"
e-mail1:rc_ware@hotmail.com
e-mail2:rc_ware@yahoo.com
e-mail3:rc_ware@geocities.com
webpage:http://www.geocities.com/SiliconValley/Haven/4049/index.html
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
Follow-Ups: