PDA

View Full Version : clipped triangle outline produces unwanted edge



quorn
08-31-2004, 01:47 AM
When my outlined triangle reaches the edge of the screen, it gets clipped and a new edge is drawn. I don't want it!

E.g.


|\
| \
| \
| /
| /
|/I'd like:

|\
| \
|
|
| /
|/But I get:

|\
| \
| |
| |
| /
|/I am actually rendering a large area with tiles which are bitmap device contexts (this is on Windows). So I pan across the large area rendering to the (relatively) small bitmap. I'm actually using the feedback buffer and translating the coodinates to the coordinates for a printed page and then using GDI calls to send to the printer.

The effect of the added edges means I get a patchy grid of unwanted edges across the page.

Thanks for any help.

Pete

quorn
09-01-2004, 01:02 AM
Should I put this question in the advanced forum?

I don't want to cross-post.

09-01-2004, 01:13 AM
what is your question as it relates to opengl?

09-01-2004, 01:17 AM
if anything, maybe put it in the windows forum.

quorn
09-01-2004, 01:51 AM
Is it possible to stop OpenGL from displaying the edges it automatically creates?

If so, how do I do it?

If there is a triangle (polygon) drawn with an outline at the corner of the screen it will be divided up into two new polygons.


/|
/ |
/ |
\ |
\ |
\|If you can imagine the bottom right corner of the screen with the above triangle just off the edge, like this:

|
|
/|
/ |
____\_|The triangle has essentially become this shape:

/|
/ |
\_|How do I stop it drawing the extra lines so that I get this shape:

/
/
\I put in the extra information about what I'm trying to do on windows so as to give more detail about limitations on possible solutions that might be presented.

This isn't an issue to do with windows specifically as far as I can tell.

I've asked this question previously in the gamedev forum here (http://http://www.gamedev.net/community/forums/topic.asp?topic_id=266570) .

09-01-2004, 02:50 AM
Not sure how if this can help you or if it can handle outline polygons, but have you ever tried the OpenGL tile rendering library?

http://www.mesa3d.org/brianp/TR.html

quorn
09-01-2004, 04:00 AM
Thanks very much for the link. Now I know I'm not crazy for trying this.

There is some info there about how it's necessary to have a border around the tile when rendering outlined polygons. So that is what I will do.

I can't really use the library as it doesn't really fit into how I'm doing things. I have control of rendering the whole scene but using the library would involve changing so that I render the scene many times. That seems to my mind to be changing something at the 'wrong' level in the application. I have a renderer which gets called when the scene is drawn and that seems the correct place to change. So the scene is only drawn once and the renderer looks after the tiles. You don't even know they're there.

I could make it so that the scene is given over to the renderer. That would actually make sense and it would be able to render it as many times as it liked. That would work but invloves more changes to the existing code... hmm decisions.

Okay, thanks again for the input. It's good to know I'm not alone.

Pete