3D Spin Menu

12 posts / 0 new
Last post
ezyclie
ezyclie's picture
Offline
Mobile Wizard
Joined: 4 Mar 2010
Posts:
3D Spin Menu

Description:
3D Spin Menu creates a virtual "ring" of menu.
It's fully customizable, from number of items, to positioning of the menu on the screen and more.

Screenshot:

NOTE: Please change the interpolation algorithm if you want faster menu rotation/animation.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Wow - this is magic. We need to do some work on making the animation faster (cache the images maybe) and convert it into a MAUI object so it can be reused more easily. I can help you with these if necessary. Very good work. I attempted something similar a while back, and ended up doing something more like an Apple fisheye component using two different sized images rather than resizing at run time, but it would be very good to get this running fast enough on a standard feature phone.

ezyclie
ezyclie's picture
Offline
Mobile Wizard
Joined: 4 Mar 2010
Posts:

@rival: Thanks, I think we need to change the interpolation algorithm for image scaling to make is faster. And another thing we need to remove some duplicated code Smile

This website talks about the Bresenham line algorithm and how it can be applied to image scaling. Supposedly it has a good trade-off between speed and quality, using integer math instead of floating point to add the process. It includes C code examples of how it can be implemented. Website is here: http://www.compuphase.com/graphic/scale.htm

Niklas Nummelin
niklas's picture
Offline
Mobile Wizard
Joined: 18 Dec 2007
Posts:

Really cool! I implemented a rather fast scaler a long time ago, that precalculates the scaled versions of each image (I guess that's what you meant by caching?).

Try to make us of this:
https://github.com/MoSync/MoSync.cpp
https://github.com/MoSync/MoSync.h

// Niklas

ezyclie
ezyclie's picture
Offline
Mobile Wizard
Joined: 4 Mar 2010
Posts:

Wah, Cool!, thanks Niklas, I am going to change the algorithm with youur Scaler and will post the result here. For caching i am not sure coz we need to think about devices that have low memory.

fatalerror
fatalerror's picture
Offline
Mobile Conjurer
Joined: 2 Oct 2009
Posts:

Very nice!

I didn't have anything better to so I speeded your resampler up a bit. There are atleast ten more things you can do to make it even faster, but I thought this was good enough for the purpose. By the way, are you storing each color component as an int? In that case you're moving three times more data then you need to.

https://gist.github.com/51182048b0add2818e95
https://gist.github.com/86758fd1b4fcc3541199

Also, you can change the pipe-tool parameters to "-datasize=225688 -heapsize=184320 -stacksize=20480"

ezyclie
ezyclie's picture
Offline
Mobile Wizard
Joined: 4 Mar 2010
Posts:

Thanks Ali,

But both your code and my code have same problem on real devices. The images looks corrupted.

fatalerror
fatalerror's picture
Offline
Mobile Conjurer
Joined: 2 Oct 2009
Posts:

Interesting, I would like to try it out, which devices?

ezyclie
ezyclie's picture
Offline
Mobile Wizard
Joined: 4 Mar 2010
Posts:

Symbian devices, Nokia 6110 Navigator & N70

andreimpi
andreimpi's picture
Offline
Joined: 31 May 2010
Posts:

Hi Guys,

I think the reason for the "distorted/corrupted" images are as follows:

According to the API "void maDrawRGB Draws an image. The source is an array of ints that represent pixels in XRGB format." whereas "maGetImageData" states "Copies an image into an array of ints that represent pixels in ARGB format." or at least this discrepancy was why I was getting red hues to fix this simply create a image from the scaled pixel array and draw to screen, code as follows:

		MAHandle IMAGE = maCreatePlaceholder();

		MAExtent textureSize = maGetImageSize(handle);
		int sTextureWidth = EXTENT_X(textureSize);
		int sTextureHeight = EXTENT_Y(textureSize);
		int *texture = new int [sTextureWidth*sTextureHeight];
		MARect srcRect = {0, 0, sTextureWidth, sTextureHeight};
		maGetImageData(handleForOriginalImage, texture, &srcRect, sTextureWidth);

		int *tmpImg = new int[scaledWidth*scaledHeight];

		//use bilinearScale from Niklas for GREAT quality but a fair speed trade-off
		//bilinearScale( tmpImg,scaledWidth,scaledHeight,scaledWidth,texture,sTextureWidth,sTextureHeight,sTextureWidth);
		//use nearestNeigbour scaling from Niklas for GREAT speed and decent quality
		nearestNeighbour( tmpImg,scaledWidth,scaledHeight,scaledWidth,texture,sTextureWidth,sTextureHeight,sTextureWidth);

		maCreateImageRaw(IMAGE,tmpImg,EXTENT(scaledWidth,scaledHeight),0);

		maDrawImage(IMAGE, (x-pos), y-pos);

		maUpdateScreen();

Hope this helps someone,

Regards

Andre

Carlos Alberto St...
carlosast@msn.com's picture
Offline
Joined: 14 Dec 2009
Posts:

Where is the source of 3D Spin Menu?

Carlos Alberto St...
carlosast@msn.com's picture
Offline
Joined: 14 Dec 2009
Posts:

Where is the source of 3D Spin Menu?