Drawing rotated ellipses, Please help.

BlitzMax Forums/BlitzMax Beginners Area/Drawing rotated ellipses, Please help.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Thanks for all the help so far.

After a brief head explosion and some mopping of the floor I came up with this.
Function draw_oval(centerx#,centery#,width#,height#,rot#,n#)
	' draw the shape with a for loop
	
	
	Local angle#=360.0/n
	Local r1#=width/2.0
	Local r2#=height/2.0

	For Local i#=0 To n-1
	
		Local x1#=centerx+Cos(i*angle)*r1
		Local y1#=centery+Sin(i*angle)*r2
		Local x2#=centerx+Cos((i+1)*angle)*r1
		Local y2#=centery+Sin((i+1)*angle)*r2
		' get new data
		Local d1#=point_distance(centerx,centery,x1,y1)
		Local a1#=point_direction(centerx,centery,x1,y1)
		Local fx#=centerx+Cos(a1+rot)*d1
		Local fy#=centery+Sin(a1+rot)*d1
		
		Local d2#=point_distance(centerx,centery,x2,y2)
		Local a2#=point_direction(centerx,centery,x2,y2)
		Local fx2#=centerx+Cos(a2+rot)*d2
		Local fy2#=centery+Sin(a2+rot)*d2
	
		DrawLine(fx,fy,fx2,fy2)
		
	Next
End Function


The problem if drawing even width ovals remains. I don't know how to draw an oval with an even width. Using a central pixel always will make the width odd. If I tell it to draw a 32x32 oval I get a 31x31 oval.