How to draw filled 2D polygons?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
alc
Posts: 31
Joined: Sun Jun 25, 2006 10:59 pm
Location: Denmark

How to draw filled 2D polygons?

Post by alc »

I want to draw a arbitrary filled 2D polygon, but Irrlicht only supports circle-like non-filled polygons in 2D. More specfically, I need to make a dial for a gauge. The gauge itself is a usual 2d image, but the moving dial I cannot figure out how to do. Any clues on how to do this?
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

I'd just draw it as a 2d image, with transparenct, put the origin at the swivel point and rotate it around that swivel point.
Image
alc
Posts: 31
Joined: Sun Jun 25, 2006 10:59 pm
Location: Denmark

Post by alc »

Well, that was actually my first idea. But I cannot find any method (through Irrlicht, anyway) for rotating an image? I guess you're saying this is possible, but how, then?
cederron
Posts: 53
Joined: Thu Jul 13, 2006 11:35 pm

Post by cederron »

Just create a plane ( a 3d polygonal plane ) and assign a texture with alpha color to it ( alpha color is a special color that is transparent. Once you have this object loaded as a scene node you can rotate it as much as you want, or scale it, translate, etc.
Post Reply