Using floats to draw 2d?

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
Mani2010
Posts: 107
Joined: Sat Jan 16, 2010 4:35 pm
Location: London,UK
Contact:

Using floats to draw 2d?

Post 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?
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Setup an orthogonal camera and draw them in 3d space.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Mani2010
Posts: 107
Joined: Sat Jan 16, 2010 4:35 pm
Location: London,UK
Contact:

Post 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);

hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Mani2010
Posts: 107
Joined: Sat Jan 16, 2010 4:35 pm
Location: London,UK
Contact:

Post by Mani2010 »

Ok, i will do it in 3d, thanks
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

Mani2010 - wise 8)
Do you like VODKA???
Image
Image
Post Reply