PDA

View Full Version : Quads



alc
03-01-2003, 06:30 AM
Hello all you gl gurus out there. I am a beginner to OpenGl and I need some help.
I need to use quads to render a model. However, when I render this model, the quads appear incomplete. I can rectify this by using quadstrips, but I need to use quads for my smooth shading. I have tried using glEdgeFlag but to no avail. Does anyone know how rectify this.

For a screenshot of the problem go to:
http://www34.brinkster.com/acdudesstuff/untitled.jpg

I hope someone can help

Thanks in anticipation

Alc

shinpaughp
03-01-2003, 10:07 AM
The link to your screenshot gives the following:

HTTP1.1 STATUS 403 Remote Access to this object forbidden This file cannot be directly accessed from a remote site, but must be linked through the Brinkster Member's site.

miko
03-01-2003, 01:41 PM
alhough i can not see any image i've got an idea... are your quads planar and convex??

alc
03-02-2003, 05:23 AM
If you get that link error, copy the link into the browser bar at the top. That should work. For some reason you cant directly hyperlink there. (It doesn't hyperlink on my machine).

I am not sure. The dataset is indescrete so I think that the quads a convex. Any ideas????

Miguel_dup1
03-02-2003, 12:41 PM
You need to understand how strips work. In the case of a quad strip, you start with two vertices and after that, every two vertices will make a quad.


You might need something like:

// First quad
curr_quad->vertex[0]
curr_quad->vertex[1]
curr_quad->vertex[2]
curr_quad->vertex[3]

// Second quad
curr_quad->vertex[3]
curr_quad->vertex[2]
curr_quad->vertex[4]
curr_quad->vertex[5]

// Third quad
curr_quad->vertex[5]
curr_quad->vertex[4]
curr_quad->vertex[6]
curr_quad->vertex[7]

You get the idea.

alc
03-02-2003, 01:10 PM
This is just it! I understand how quadstrips work, but when I pass a 4 independent vertices to gl_quad as opposed to a 2 vertices to a quadstrip for each quad I want attached to the previous, I get the image the URL above points to.

I am providing complete information (4 vertices) for convex simple quads but just seem to get some sort of triangle fan pattern instead. I am not entirely sure why!

REgards

Alc

Miguel_dup1
03-02-2003, 01:22 PM
I did not mean to insult you... Sorry about that.

Send me the code. I am pretty sure it is the winding you are having problems with. Did you try the order of the vertices as I showed above?

mancha_c@hotmail.com

Miguel Castillo

[This message has been edited by mancha (edited 03-02-2003).]

alc
03-03-2003, 12:19 AM
Its ok, I was not insulted, my post before sounded as though I was! My mistake No harm done i'm sure!

The code I am using is in a massive 200000 + polygon loop! Will take some time to adjust them for this.

Will keep ya posted

Alc