I am developing a game and I want to give a smoke effect at the tail of the objects moving freely on the screen. I just created a bitmap and attached it at the end of object but the problem is that this doesn't look good because when the objects turns towards a new angle the effect doesn't curve it self. All I want is to know that how can I do this? Is there any possibility to give curve to the bitmap or another solution? I want to give a smoke effect at the tail of a bike. I hope someone will provide me a solution.
Thanks
Yes. Finally I got the answer myself so sharing it with you.
What I wanted was to give a smoke effect at the tail of a moving object such that when the object take turns in screen the tail should do the same.
What I do us that I take four bitmap images which gives a smoke effect when combined.
I recorded the points X and Y which the boat has passed from and then drew the bitmap on these points which solved my problem. I hope it will help someone else someday so I shared it.
Thanks
Related
Fairly new at android dev, haven't got any code for this particular step yet so ill try give as much detail as possible. I'm trying to make an ImageView object move around the android view/activity, unlike java im not able to use the random generator to translate it onto an x and or y position on the frame, if anyone could point me on the right direction or more importantly have a good idea on how to do this, that'd be great.
There is a class in android called Random. And there is a function called nextInt() which can give you a random number. You can also calculate the width and height of your screen using DisplayMetrices so that you can keep the image inside the device's screen. And you can also move the ImageView. See this link.
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.
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!
I have an app where users are moving on a View background, I'm drawing the users, but would also like to display a trail after them with a few seconds of history.
I could do it using a bunch of line segments, but I worry that would be inneffective.
I would like some preimplemented class that performs this, so I don't have to get my hands dirty with making the actual drawing efficient. I was thinking in the lines of a of a android.graphics.Path, but I can't find a way to contonously remove the oldest parts of it. Is there a way to achieve this using a path?
If not does anyone have any other tips? Anywhere I could look for a handy and efficient solution?
Grateful for any help!
You could take the current view, mix it with the original background and use that as the new canvas to draw your users on for the next/upcoming frame. This will give a blurry trail (depending on the way you combine it with the original background) of the users.
I need to get the area of a known object inside a scene to get the distance from that. The problem is rectifying it so that the area is independent from the angle.
I'm using opencv (on Android) with some java code that is equivalent to this:
http://docs.opencv.org/doc/tutorials/features2d/feature_homography/feature_homography.html#feature-homography
In other words: how do i get the area of the object observed perpendicularly from that distance given the H matrix.
Thank you in advance and sorry for my poor english... :)
You can call cvCalibrateCamera, but am not sure if it works with one image only. The algorithm it is based upon can cope with the one image case, see section 3.1. where it says "if n=1...". So in a pinch you can re-implement it.