Page 1 of 1

Using floats to draw 2d?

Posted: Thu Oct 21, 2010 5:58 pm
by Mani2010
Is there a float version of the draw2d functions?

I use to use popcap and they had a float version of their draw functions for smoother drawing, noticed the difference when i ported some of my game code over to irrlicht.

If none, any ideas on how to draw 2d images/polygons smoother?

Posted: Thu Oct 21, 2010 6:09 pm
by Sylence
Setup an orthogonal camera and draw them in 3d space.

Posted: Fri Oct 22, 2010 5:05 pm
by hybrid
Well, subpixel positioning? Just calculate positions on your own, and draw where you think it should end. You cannot get better precision than per pixel.

Posted: Sat Oct 23, 2010 11:59 am
by Mani2010
Would like to solve the problem in 2d if possible first.

As for the pixel suggestion, possible i could get a code example?
This is what i currently do to draw a circle.
The variable "m_vPos" is a vector2df.

Do you mean calculate the 15 points using x = cos(angle), y = sin(angle)?
If so how would that be any smoother? as the drawPixel function paramaters are u32.

Code: Select all

		

g_pApp->GetVideoDriver()->draw2DPolygon(core::position2d<s32>(m_vPos.X,m_vPos.Y),m_fRadius,m_Color,15);


Posted: Sat Oct 23, 2010 12:56 pm
by hybrid
Well, the thing is that the minimal unit you can use is that of a pixel. You cannot go beyond that (in 2d) without major overhead. But you can use 3d and position arbitrarily.

Posted: Tue Oct 26, 2010 11:07 am
by Mani2010
Ok, i will do it in 3d, thanks

Posted: Tue Oct 26, 2010 11:22 am
by Bear_130278
Mani2010 - wise 8)