Welcome! Log In Create A New Profile


Making Circle

Posted by Japster 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Making Circle
March 06, 2009 06:16PM
I have been struggling to make an circle for the head of the stickman for Assgnment 1. Can someone please just assist me. How do you go about drawing a circle?
avatar Re: Making Circle
March 06, 2009 07:35PM
From the Red Book:

#define PI 3.1415926535898
GLint circle_points = 100;
for (i = 0; i < circle_points; i++) {
angle = 2*PI*i/circle_points;
glVertex2f(cos(angle), sin(angle));

You can also use:
#include <cmath>
and then the constant M_PI which is defined in cmath.h
Re: Making Circle
March 14, 2009 02:44PM
Thanks. that was what i thought about using.
Sorry, only registered users may post in this forum.

Click here to login