Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
perfect circle #247364
01/20/09 14:01
01/20/09 14:01
Joined: Jul 2007
Posts: 959
nl
F
flits Offline OP
User
flits  Offline OP
User
F

Joined: Jul 2007
Posts: 959
nl
i want to create a bmap white a circle
the problem is that the circle isnt 100% full
there are missing pixel

Code:

BMAP* circle; circle = bmap_createblack(sz[0],sz[0],24);
	
	var format;
	var i = 0;
	var pixel;
	
	var x;
	var y;
	var a;
	
	format = bmap_lock(circle,0);
	pixel = pixel_for_vec(clr[0],100,format);
	while(i < 100)
	{
		a = 0;
		while(a < 360)
		{
		x = sinv(a)*(sz[0]/2-i) + sz[0]/2;
		y = cosv(a)*(sz[0]/2-i) + sz[0]/2;
		pixel_to_bmap(circle,x,y,pixel);
		a += 1;	
		}
	i += 1;
	}
	
	
	bmap_unlock(circle);
	



"empty"
Re: perfect circle [Re: flits] #247378
01/20/09 15:54
01/20/09 15:54
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
didnt tried but maybe it would be a<=360 ?


3333333333
Re: perfect circle [Re: Quad] #247397
01/20/09 17:15
01/20/09 17:15
Joined: Jul 2007
Posts: 959
nl
F
flits Offline OP
User
flits  Offline OP
User
F

Joined: Jul 2007
Posts: 959
nl
i got it i just rezided the angle

Code:
{
BMAP* circle; circle = bmap_createblack(sz[0],sz[0],32);
	
	var format;
	var i = 0;
	var pixel;
	
	var x;
	var y;
	var a;
	
	format = bmap_lock(circle,0);
	pixel = pixel_for_vec(clr[0],100,format);
	while(i < sz[0]/2 + 1)
	{
		a = 0;
		while(a < 360)
		{
		x = sinv(a)*(sz[0]/2-i) + sz[0]/2;
		y = cosv(a)*(sz[0]/2-i) + sz[0]/2;
		pixel_to_bmap(circle,x,y,pixel);
		
		a += 0.1;	
		}
	i += 1;
	}
	
	bmap_unlock(circle);
	



"empty"

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1