![]() |
|
Polygons only visible from one side |
mEmO
Member #1,124
March 2001
![]() |
I have met yet another problem in allegro GL. I have started work on the 3d modeling system, and have gotten the V*E*R*Y basics of the model classes together. But, when I try and render them, the models (only flat polygons for now) are only visible from one side. So that if I walk arround the object, it disapears. I have turned my head inside out, bu still cant find the reason. I'm sure I am missing something fundamental... And just to make sure: Dev-C++, allegro 3937, Allgro GL 0.0.25 --------------------------------------------- |
Steve Terry
Member #1,989
March 2002
![]() |
I can't give you a solution to this.. but it's completely normal.. OpenGL and DirectX only render one sided.. you must render two polygons, one flipped to see it from both sides. ___________________________________ |
Mike Farrell
Member #248
April 2000
![]() |
What you are experiencing is called "backface culling". It's actually quite useful. This makes it so that any outward surfaces of a closed object are not drawn when they are not needed to be. (in lamens terms, any polygon whose perpendicular line [the normal] that is facing away from the screen will not be drawn). This way if you create a closed 3d object that has all of it's polygons facing inward (like a cube or a boxed car), the processor ins't waisted on the polygons that it'll draw over anyway. Ok sorry for explaining what you probably don't care about here's the code to turn it off :-) //Call these to turn off the backface culling defaults glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glDisable(GL_CULL_FACE); //To bring it back, I use these calls glCullFace(GL_BACK); glEnable(GL_CULL_FACE);
|
Thomas Fjellstrom
Member #476
June 2000
![]() |
Steve> (see? no stevie! -- |
Steve Terry
Member #1,989
March 2002
![]() |
yeah thanks for finding all my bugs.. yes I know about them.. I know about them all .... hahahhahhahhaha, I tried to fix it, but I guess it wasn't completely fixed... it lies in the deleting of a linked list node.. and it's either if you right click after.. or before the last tile on the map. Basically I messed up the whole linked list thing by allocating a node as the base node first.. when it's simpler to just do head=NULL; I'll fix it when I get back to it after finishing my GUI.. which looks like next year sometime at teh rate I'm going.. but if anyone want's to add to my GUI, just e-mail me the changes and if I like them it will become part of the release, of course it's freeware anyway, you can change it on your machine all you want. Backface culling helps when you have a polygon object that's not a single plane, that way you are not rendering useless stuff you will never see. ___________________________________ |
Thomas Fjellstrom
Member #476
June 2000
![]() |
hehe. ok. um... I've mentioned this before.. how about a multi-line text edit? At this rate I'll have it done first, and I don't have access to my computer. -- |
Steve Terry
Member #1,989
March 2002
![]() |
I was thinking a multiple line text editor, console (terminal), um maybe an amp player if you link with fmod.. and possibly a DUMB wrapper, but I have never used DUMB.. maybe someone else can write that up, I know with fmod I have access to the DSP for an equalizer. Right now i'm adding another skin.. I do this just to see if I have any downsides.. it's BorgX for NEXTstart.. hasn't been easy and I need to add more functionality to make it look right.. shouldn't be to hard though.. it's stuff I knew about already. What I really need to get started on is some Dialog routines that are not dependent on x and y coordinates, similar to my menu, like an array of buttons, and attaching them to the dialog so it can be resized and they will be "attached" to an edge. ___________________________________ |
Thomas Fjellstrom
Member #476
June 2000
![]() |
I've never really been able to figure out the code, but something akin to the 'pack' method in TCL/Tk would be awesome. It allows you to resize the dialog, and every object placed with 'pack' will just flow to its new possition, which depends on which options you set like: for doing GUIs that sort of thing is really nice, trying to do the same layout in QT as in Tk would take a buch of 'Q*BoxLayout's... -- |
|