By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,778 Members | 1,947 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,778 IT Pros & Developers. It's quick & easy.


P: 5
l have failed write a code to draw a blue or any coloured triangle or shape
Oct 2 '06 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 5K+
P: 8,916
Congratulations, but you have not

Fully described your problem
Posted the non-working code
Asked a specific question we can help you with

With-in the limits of the data you have provided I offer you this solution

1. Obtain the following items: a ruler, a piece of paper and a working blue pen

2. Put the paper on a flat surface

3. Put the ruler on top of the paper

4. Make sure that the top is off then pen

5. Holding the ruler in place with one hand and using the other hand to hold the pen place the nib of the pen on the paper against one end of the ruler

6. Pressing lightly down on the pen move it to the other end of the ruler

7. Remove the pen and ruler from the paper.

8. Admire the nice blue line

If you want a sensible anwser I suggest you ask a sensible question.
Oct 2 '06 #2

P: 293
There should be sample OpenGL code that draws a spinning triangle with one red, one green, and one blue colored vertex. If you remove both lines of code that mention theta, the push and pop becomes unnecessary, and then change the color to blue like this:
Expand|Select|Wrap|Line Numbers
  1. glBegin( GL_TRIANGLES );
  2. glColor3f( 0.0f, 0.0f, 1.0f ); // BLUE
  3. glVertex2f( 0.0f, 1.0f );
  4. glVertex2f( 0.87f, -0.5f );
  5. glVertex2f( -0.87f, -0.5f );
  6. glEnd();
Oct 2 '06 #3

P: 5
come on, l meant a c code that can do that
Oct 3 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.