Smoothing?

phr0zen81
Unregistered
 
Post: #1
Hello, i got Delphi and CG package, i am trying to convert

this

into

this

any idea how? im drawing the polygons using glVertex3f and setting the colors
with glColor4ubv, all the polygons have 4 vertexes.

Thanks!
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #2
What I think you are looking for is using blending and or masking.

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
phr0zen81
Unregistered
 
Post: #3
Im really n00b when it comes to GL, a little code snippet would be really appreciated..im only using 15 colors for what im doing.
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #4
These should get you a little background in opengl masking and blending

http://nehe.gamedev.net/data/lessons/les...?lesson=08

and

http://nehe.gamedev.net/data/lessons/les...?lesson=20

BTW welcome to iDevGames

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
phr0zen81
Unregistered
 
Post: #5
Ive went trough the lessons, fiddled with glBlendFunc and no results, im not even working with any textures, or do i need to ?
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #6
no you dont have to just mask off the areas you want to have as a solid color in the pattern you want, then turn blending on.

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
phr0zen81
Unregistered
 
Post: #7
OK, ive went in depth with them tutorials, i got some (poor) results but not quite what i want, them polygons are still squared like, not smooth like the picture sample i posted...i need sharp edges!!

didnt want to get into bezier formulas...something simple im missing im sure!!
Quote this message in a reply
phr0zen81
Unregistered
 
Post: #8
dList := glGenLists(1);
glNewList(dList, GL_COMPILE);
glBegin(GL_QUADS);
PL is an array of 15 colors

Code:=4;
glColor4ubv(@PL[Code]); //
glVertex3f(P.X, P.Y, height);
glVertex3f(P1.X, P1.Y, height);
glVertex3f(P3.X, P3.Y, height);
glVertex3f(P2.X, P2.Y, height);

Code := 5; //
glColor4ubv(@PL[Code]); //
glVertex3f(P4.X, P4.Y, height);
glVertex3f(P5.X, P5.Y, height);
glVertex3f(P6.X, P6.Y, height);
glVertex3f(P7.X, P2.8, height);

glenable(GL_BLEND);
gldisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
gluPerspective(230, 1, 1, 500);

each one of these is a GL_quads with one color, the next quad im gonna plotting might, or might not be the same color.

give you a little idea what im working with, perhaps some bells will ring, http://nexrad.cjb.net
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Smoothing geometry via subdivision TomorrowPlusX 1 2,852 Aug 30, 2007 02:46 PM
Last Post: OneSadCookie
  Smoothing tangents for bumpmapping TomorrowPlusX 1 2,584 Aug 13, 2007 10:54 AM
Last Post: TomorrowPlusX
  Smoothing out curved aliased texture edges WhatMeWorry 2 3,193 Dec 15, 2005 05:11 AM
Last Post: dfmoore
  Smoothing edges with alpha mask McSebi 18 9,834 Nov 3, 2005 11:39 AM
Last Post: McSebi
  polygon smoothing problem Sord 6 4,307 Mar 21, 2005 01:12 PM
Last Post: Sord