how to draw a filled circle

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
thatax
Posts: 25
Joined: Thu Jul 31, 2008 7:33 am

how to draw a filled circle

Post by thatax »

draw2DPolygon just can draw a non filled circle.

another question: wheather irr supports drawing text on the screen or not,not using conctrols.
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

to answer another question, text can be shown on the screen without any gui element, like this:
GUIEnvironment()->addStaticText(L"PERA",rect<s32>(20,20,200,40),false,false,0);
just make sure parameter "parent" is 0.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

That still uses a GUI element though; IGUIStaticText.

You can also use IGUIFont::draw();
Image Image Image
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

Ok is this "Beginners Help" thread or "Pros Help"?
Only beginners suppose to help here. You know too much :)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

*scribbles out pera's name on his list of people he's willing to help*

:lol:
Image Image Image
thatax
Posts: 25
Joined: Thu Jul 31, 2008 7:33 am

Post by thatax »

thx, it's done.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

There's no Irrlicht method (AFAIK) that supports drawing filled 2D polygons. It would be possible to write one (that draws untransformed triangles), but could you just draw a circle bitmap instead?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, the video driver method produces unfilled polys, but OpenGL has a polygon primitive. Thi sin't supported by the other drivers, yet, but would probably a good place to start. The concyclic regular polys which would be used for a circle could also be made more generic and support a material or at least colors...
ehenkes
Posts: 47
Joined: Sun Aug 03, 2008 2:52 pm
Location: Germany
Contact:

Post by ehenkes »

Use an image, define a transparent color (e.g. black or magenta) and render with "draw2DImage(...)" between driver->beginScene and driver->endScene:

Code: Select all

ITexture* pFilledCircle  = driver->getTexture("FilledCircle.png" );
if(pFilledCircle) 
  driver->makeColorKeyTexture(pFilledCircle, SColor(0,0,0,0)); //transparent color
//...
driver->draw2DImage(pFilledCircle, position2di(0,568), rect<s32>(0,0,400,200), 0, SColor(150,255,255,100), true );
Post Reply