Computer Science Canada 3D Code Help |
Author: | SNIPERDUDE [ Thu Aug 28, 2008 8:35 am ] | ||
Post subject: | 3D Code Help | ||
Ok, so I have the basics of 3D. I think it's right... Anyways I have hit another snag, how do I make it so I can fill in faces or make it so some lines are hidden (when behind another face)? Here's what I have so far:
Use the arrow keys to move the house around, the 'W' key to zoom in, and the 'S' key to zoom out. |
Author: | Clayton [ Thu Aug 28, 2008 9:33 am ] |
Post subject: | RE:3D Code Help |
10 million isn't exactly a very good estimate of x/0, I suggest you go with something bigger, like maxint. |
Author: | Zren [ Thu Aug 28, 2008 12:09 pm ] |
Post subject: | Re: 3D Code Help |
Your either looking for: Back-Face Culling: Ignore drawing the polygons that aren't seen. http://www.gamedev.net/reference/articles/article1088.asp ![]() Painter's Algorithm: Set each polygon to a certain depth, sort that list, then draw each polygon. The Java link is to the basic list generation, you get many errors with that much with polygons that cover each other. So there are some imperfect tests to run in order to slightly fix things. http://www.javaworld.com/javaworld/jw-07-1997/jw-07-howto.html?page=1 ![]() http://www.siggraph.org/education/materials/HyperGraph/scanline/visibility/painter.htm Personally I haven't done either before. I tried working with the Painter's algorithm once though. It kinda failed which is why Virus was old-school vector display styled. Zylum's 3D Engine has both of these in it and is good to look at in order to understand concepts. http://compsci.ca/v3/viewtopic.php?t=9639 |
Author: | SNIPERDUDE [ Thu Aug 28, 2008 5:02 pm ] |
Post subject: | RE:3D Code Help |
Thanks guys, no time to look at it now... I'll let you know how it goes when I have the time to look at it... |
Author: | CodeMonkey2000 [ Thu Aug 28, 2008 11:04 pm ] | ||
Post subject: | RE:3D Code Help | ||
I think that using the z-buffer algorithm might be easier and the most correct, but since you can't use a graphics accelerator it will be VERY slow. Striahgt from gamedev:
|
Author: | SNIPERDUDE [ Fri Aug 29, 2008 6:47 am ] |
Post subject: | RE:3D Code Help |
Thought about that one. Would it run at any good speed in C++? |
Author: | CodeMonkey2000 [ Fri Aug 29, 2008 10:33 am ] |
Post subject: | RE:3D Code Help |
Well if you are using openGL, it does it itself, just enable GL_DEPTH_TEST and make sure you clear the depth buffer. OpenGL can do it faster too since it uses hardware acceleration, you don't need to use the painter's algorithm in openGL, since it's not that much faster anyway. |
Author: | SNIPERDUDE [ Fri Aug 29, 2008 6:44 pm ] |
Post subject: | RE:3D Code Help |
Meh, first I'll think I'll try learning the painter's algorithm before I try learning other languages... |