Solved

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

Posted on 2007-03-30
4
562 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

739 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