|Re: [xmoto-dev] SDL_gfx help|
[ Thread Index |
| More lists.tuxfamily.org/xmoto-dev Archives
- To: xmoto-dev@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [xmoto-dev] SDL_gfx help
- From: "Kees Jongenburger" <kees.jongenburger@xxxxxxxxx>
- Date: Thu, 25 Jan 2007 05:38:20 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kkEymsiW81wWwwzrfRrCFSs8lG4yUQDyFQDU34VYx3jjMp7PqVn8t4AfWeQ4gdH/XC0/thUxMMig2Ipd4a9xlzHQrSmx2SvIbws/fLIBOyfDXdS0cU8afOEFWmOUEaQaitUR6fDSW8Nfcxny1ARfLkFUfMEovNzFCibfHVvu6zY=
transformations or anything. I don't know about SDL_gfx, but making
such a drawing function should be quite basic - interpolate the x
(screen) coordinate and the u,v (texture) coordinates over the edges
of the polygon, and then render the horizontal lines of the polygon
(with interpolated u,v coordinates). Nice thing about x-moto is that
no perspective correction or shading is required - i.e. it can be
implemented quite efficiently in plain c/c++ (even with no asm).
This will not work when the object is rotated like the wheels
and the width/height ration of the body is changed. or am I missing something?
My function first creates the "full" texture to only later apply it
this i why I think I need to define the transformation the texture has
Sub-pixel accuracy (or texture filtering) is probably not required
either, if it just has to be fast.
Actually I thought SDL_gfx provided such functions?