|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: Wed, 24 Jan 2007 12:45:45 +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=ZssUeWyZxZGtH9IO5QLrLqgWvN5MUx4j59WC+Q0fgYHalCqs/YulfCxE4/p+XRLPZGBTpc0NrFmS+kuvEjIxwCTNHbZozOfnVryWONSlCx856EE2kkQS92ZwfKyKYw17f8GRND8kZkO5NqGebRa2PSQSRXceZ9qqDM6h0c8notI=
On 1/24/07, Rasmus Neckelmann <neckelmann@xxxxxxxxx> wrote:
On 1/21/07, Kees Jongenburger <kees.jongenburger@xxxxxxxxx> wrote:
> So given the input texture , the texture coordinates and the vertex
> coordinates I want to define a transformation on the base image. we
> are in 2d space and do not perform squeaking. The transformations that
> are possible are scaling,rotating and flipping .
I'm not sure I understand your problem correctly... Ideally it should
be possible to draw any textured polygon, not knowing about
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).
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?
Yes, the funtion it there but there are some rendering bug.
You make it sounds so easy that I would really
appreciate if you could take some time to look into it.
95% of the code is there it only really requires a few magic lines of math
to determine the rotation x and y zoom of the texture.
I can not do anything else until I get this fixed. I would like to
start helping whit the network play and implementing more performance