Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Moving the vertex coordinates in a textured quad?
- By Maverick Date 2009-06-22 18:32
I have an image and I want to be able to draw it normally but change a few coordinates of either the top-left, top-right, or bottom-left, and bottom-right of the image. I know I can change the color of the edges by drawMod() but I couldn't think of any way to do what I want to do. Is that possible yet or ever? Coolio. Thanks.
- By jlnr (dev) Date 2009-06-23 01:52
You mean you want to transform the image to a nonrectangular shape (e.g. a diamond)? There is the Image#draw_as_quad function in Ruby which is used in the same way as Window#draw_quad. In C++, it is perhaps a bit harder to discover: myImage.getData().draw(...).

Neither of the three functions I mentioned is particularly pretty to use, they're meant as building blocks, so feel free to write a wrapper for your specific problem :)
- By Maverick Date 2009-06-23 02:10
I thought about using the draw method in ImageData, but I saw it was pure virtual so I assumed it wouldn't actually draw anything. Awesome. I can continue with my evil schemes.
- By Maverick Date 2009-06-23 21:36
Another quick question, how are the quads drawn? More specifically, what is the order of vertices in which the quad is drawn?
- By jlnr (dev) Date 2009-06-23 21:58
Wherever applicable, you can pass either clockwise coordinates (TL, TR, BR, BL) or "reading order" coordinates (TL, TR, BL, BR).
Up Topic Gosu / Gosu Exchange / Moving the vertex coordinates in a textured quad?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill