Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,619 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İ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 | 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