Solved

OpenGL School Project Arch simple rectangle with transparent half-circle need help ASAP

Posted on 2007-03-30
4
563 Views
Last Modified: 2013-12-21
http://img503.imageshack.us/my.php?image=clipimage002yr3.jpg

The image above is essentially what I must draw with my openGL program.
This is for a school project, and I am not doing very well so if I mess this up I am resigned to a grim fate.
I'm pretty confident that I could handle everything *BUT* the notch in the block as simple as it looks. I know maybe this has something to do with transparency but I feel clueless right now. If anyone has any idea how I could do the notch in the block to make an 'arch' please let me know. I have only a few days left to figuere this out or I am dead meat.
0
Comment
Question by:lordvr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 18854262
Does it have to use transparency?
It would seem simpler to just draw a polygon - defining the arc yourself; (with a little bit of pythag, that shouldn't be particularly difficult)..
0
 
LVL 25

Accepted Solution

by:
InteractiveMind earned 500 total points
ID: 18854277
Try

float W=200, H=100, ar=50; // W is the width of the rectangle (which contains the arc),
                                              // H is the height of the rectangle (..)
                                              // ar is the radius of the arc
glBegin(GL_POLYGON);
glVertex3f(-W/2,0,0);
glVertex3f(-W/2,H,0);
glVertex3f(W/2,H,0);
glVertex3f(W/2,0,0);
for(float i=ar; i>=-ar; i--)
{
    gl.glVertex3f(i,(float)sqrt(ar*ar-i*i),0);
}
gl.glEnd();
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question