Shearing an image/texture update

BlitzMax Forums/BlitzMax Programming/Shearing an image/texture update

Grey Alien(Posted 2015) [#1]
Hi all, just wanted to see if there's any way to do this since therevills thread ( http://www.blitzbasic.com/Community/posts.php?topic=97659 ) and I think mine from even further back about getting a texture and adjusting the corners so it looks like it's got perspective on it in a 3D space.

I'm guessing that odd2dmodule ( http://www.blitzbasic.com/Community/posts.php?topic=104369 ) could handle it with the DrawPolyImage, but are there any native commands or easy ways to do this that don't override the default Bmax graphics drivers (makes me paranoid)? Or perhaps a similar way to safely extended the native Bmax drivers with just a simple drawpolytexture function?

Thanks!


GW(Posted 2015) [#2]
Not sure exactly what you're asking about.
Does this help?
http://stackoverflow.com/questions/15242507/perspective-correct-texturing-of-trapezoid-in-opengl-es-2-0


Grey Alien(Posted 2015) [#3]
Yeah that's what I'm asking about. Does anyone have code to do that in BMax (in DX and OpenGL)?

I saw you post about textured poly code in another thread. Any idea if that works on vanilla BMax without module hacks or extending the graphics drivers (always makes me paranoid)? OK I found it ( http://www.blitzbasic.com/codearcs/codearcs.php?code=1812 ) and apparently it doesn't need module hacks, but does only seem to be DX7 so I'll have to try on DX9 and see what happens ... gibber!


GW(Posted 2015) [#4]
I use the textured poly code all the time, It's useful for all kinds of things, but I only use the GL version.
In fact, I'd say the combination of textured poly and render to texture allow for almost total control of the output and are the most useful graphics commands in the (extended) Api.


Grey Alien(Posted 2015) [#5]
Render to texture is still slow though right? By slow, I mean too slow to do realtime every frame - you have to prerender stuff with it.

OK someone else told me it's not slow, and that I'm thinking of using grabimage (which is very slow).

Do you have any BMax examples or DX examples for render to texture? Even if in C++ it should be possible to shoehorn that into BMax. Thx.