animation with sprite 2D android - android

I am building a virtual store with the effect same like this
enter link description here
The user can freely rotate the image from left to right and top to bottom or vice versa. I suppose to use sprite 2D to implement that animation. There are some tutorials I found but because Im pretty new about graphic programming so could anyone point me to the correct way that approach my expected performance. Thanks a lot.

The easiest way is to use the Canvas API in Android. Here is an example of how to use it with sprites.

Related

Image distortion on touch

There is an app named Funny Face Effects on the play store.
I am trying to achieve the effect in which when a user moves the finger on image, pixels under the finger in certain radius shifts in that direction. It feels like moving a cloth with a finger or moving some thick paste with the finger. I could not find a proper name but I think it is called smudge/liquify.
After searching and trying I found that I can achieve this with GPUImage library.This library uses OpenGL fragment shader to apply some effect on image.
How can I achieve this effect without using the GPUImage library? Thank you.
Plenty of libraries are there in the github. Search for it. Here is a nice one : https://github.com/imgly/imgly-sdk-android-demo

How to spin an image in android?

I have an image. i want it to spin/flip 360 degree continuously. All the tutorials i m referring are of rotating image 360 on a 2D axis.
I tried using the rotate animation from android but it has same problem of rotating around a point but not 3D spin or flip.
Thanks
What you are describing sounds very similar to a card flip (google android documentation). Bare in mind that you need to think about what is on the opposite side of the image (for your specific use case) if you are going to implement that.

Detect eye ball

I am developing an app which will change the color of your eye. I need some help about detecting eye ball. Currently i have a selector that will be used to reduce ROI. It look like
this
So who we can detect eye ball from that selected region. I was thinking about changing the image to grayscale and then detect big black spot from that and then change color of it which will be the next step. i'll really appreciate any help.
Your way of thinking about a returning pattern is a good start. I am doing some work on a pattern recognition chair as well, so here is some help for your task:
using a grayscale is a good start btw ;)
There are some "facts" that are always applicable to a non pathologic eye:
the center is dark
left and right side surrounding dark ball are almost white (depends on how open the eye is)
do not forget: you have 2 eyes. link them together in some way (usually they are on an approximately horizontal line)
there is usually motion in the eyes while the other regions of the picture are relatively calm
Of course I cannot provide any code here, this would blast this whole post, but I hope I could help you in some way.
I found some link these guys detecting pupil of the eye. May b this will help you . See here and here
you could use the template matching method from open cv. template matching
this will help you find the eye in most of the cases.
Another solution would be to convert your image into an edge image with e.g. canny edge detector from opencv. and then search for this pattern with the template matcher. Using the edges makes you independent of the color. Using grayscale images will also facilitate the procedure.

Which software is required to create android sprites?

I am completely new to android game programming. I really dont have any idea how can we create animated sprites. I have seen this guy using that amazing application RUBE to create a game character http://www.youtube.com/watch?v=bBIXpu-D_Zo can we do that stuff in android too ?
Even if we can how can we load such massing character to our andorid project. I accept i am noob at this but i have great interest in game development, please help me with detailed answer.
Thanks in advance
What you'll need is a sprite sheet. A series of images on the same bitmap laid out in a grid. For example you would have 8 different sprites of the same character, 1 standing still., 1 left foot forward, 1 right foot forward and jumping and again facing the opposite direction.
When you draw the sprite set the coordinates to be drawn and on button presses change the variables controlling the coordinates.
A good tutorial is here http://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/
and a sprite sheet maker can be found here http://www.codeandweb.com/sprite-sheet-maker
Hope this helps!

What is the Android equivalent of Graphics g.translate(xPos,yPos); ?

The background of my game is going to be scrolling. Instead of making it scroll by moving all the objects in relation to my main character, I want to just move the camera to follow him.
I could do that with g.translate(x,y) in java but what is the equivalent in Android?
Also, if you want let me know your thoughts about if moving the camera is the best choice. Why does everyone just make the background move, and not the camera?
Thanks!
I could do that with g.translate(x,y) in java but not sure how in Android.
The equivalent would be c.translate(xPos,yPos), where c is of type Canvas.
Also, if you want let me know your thoughts about if moving the camera is the best choice. Why does everyone just make the background move, and not the camera?
Probably because they are unaware they can apply matrix transformations to drawing operations.

Categories

Resources