Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-31-2008, 08:09 PM   #2 (permalink)
QuantumDoja
Registered Member
 
Join Date: Aug 2008
Location: London/Peterborough
Posts: 562
QuantumDoja is on a distinguished road
Default Spheres

Hi, your correct, there is no support for circles, however this might help you...it doesnt work perfectly for me...but have a play

Code:
void GLDrawEllipse (int segments, CGFloat width, CGFloat height, CGPoint center, bool filled)
{
	
	GLshort vertices[64];
	int count=0;
	for (GLshort i = 0; i < 360; i+=(360/32))
	{
		vertices[count++] = (cos(degreesToRadian(i))*32);
		vertices[count++] = (sin(degreesToRadian(i))*32);
	}

	glVertexPointer (2, GL_SHORT , 0, vertices); 
	glDrawArrays ((filled) ? GL_TRIANGLE_FAN : GL_LINE_LOOP, 0, 32);
	
}

-(void)GLDrawCircle:(int)circleSegments circleSize:(CGFloat*)circleSize center:(CGPoint*)center
{
	GLDrawEllipse(circleSegments, *circleSize, *circleSize, *center, FALSE);
	
}
btw this code has been hacked about.....A LOT
QuantumDoja is online now   Reply With Quote
 

» Advertisements
» Online Users: 425
15 members and 410 guests
Alexanskoo, aziz, diane21, elhanche, freewind, guillermotricia, hrushikeshaddon, iram91418, nicsmotherman, pipposanta, PixelEnvision, poke, QuantumDoja, ryantcb, subhan1
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,609
Threads: 94,084
Posts: 402,783
Top Poster: BrianSlick (7,990)
Welcome to our newest member, diane21
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:50 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.