I want to rotate sprite around the its axis with "perspective" effect. In this case rectangle sprite should be transformed to trapezoid. The visual effect which I want to reach is shown on picture:
Visual effect from the right part of this picture can be reached by simple Sprite:scaleX(), but it is not what I want.
I've experimented with meshes and transformation matrixes. Meshes is not useful for this task: by using mesh I can create trapezoid filled with texture, but this texture won't be transformed to trapezoid
My experiments with transformation matrix were more succesfull I could reach the effect like this:
but it is not something that I wanted...
Is it possible to perform such visual effect as I want? I saw this discussion:
http://www.giderosmobile.com/forum/discussion/3775/is-it-possible-to-flip-a-sprite-with-a-3d-effect/p1, but haven't found answer for my question there.
Comments
The other alternative (iOS only) is to use a plug-in that rotates a UIView.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Fragmenter - animated loop machine and IKONOMIKON - the memory game
docs.giderosmobile.com/reference/gideros/Mesh/setTextureCoordinate#Mesh:setTextureCoordinate
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I'd done several tests with mesh and texture coordinates and got such result:
It looks better then result from my first post, but it's still not what I expect. Do you have ideas how to get rid from the border in the middle of this figure?
This figure created by this code:
>> but if you were to split the image into smaller strips
Sorry, but this solution don't looks like right way.
if you only rotate one and you really want that with perspective, then i think that so far you cannot do that in gideros, but correct me @ar2rsawseen. however, with opengl2 and shaders this might be possible, in a future version of gideros.
this is the problem you went into:
http://en.wikipedia.org/wiki/File:Perspective_correct_texture_mapping.jpg
Fragmenter - animated loop machine and IKONOMIKON - the memory game