Game Development Community

Mulitple Image zoom

by Mags · in Torque Game Builder · 08/04/2011 (12:54 am) · 10 replies

Hi all,

I'm working on a project that I'd like to develop and was thinking of using Torque 2D. I have some programming experience but it's definitely an area I could use some guidance in.

I'm interested in recreating a series of images for iPad/touch device that can be zoomed into, like so (except using touch input):

http://www.zoomquilt.org/

Does anyone have any recommendations/starting points for me? Is that something Torque 2D can create in a straightforward way?

Cheers,

M.

About the author

Recent Threads


#1
08/04/2011 (7:11 am)
@Mags - Greetings and welcome to the GG forums. First, let me say I am a huge fan of image zoom art. I sometimes spend a near hour going through the same one multiple times.

I never actually thought of trying to make one using Torque 2D or iTorque 2D. My head is already swimming with potential ideas, but it's all theory. I believe it's possible to get a very (VERY) rough prototype using stock engine code, maybe even just script, but I do not know how smooth the transitions will be.

From the example you posted, I can barely make out three seamless images visible during a zoom. It's possible to load all the images you would need, add three static sprites to the scene, then start scaling them toward the screen (simulating camera zooming in). When one is fully out of view, set reduce back to the smallest scale, switch to the next image, then start the scaling again. Again, theory.

I have seen open-source projects that walk programmers through custom pixel manipulation, smooth image scaling, etc. It's possible some C++ modifications might be required, but I wouldn't know until I actually laid hands on code.

Edit - I moved this thread to the T2D forum to help it get more attention from other engine users
#2
08/04/2011 (10:59 am)
I just had a couple of conversations with other iOS programmers and came to a conclusion, which could potentially get me flogged by the higher-ups. Unless you are wanting to add game play to what you are describing, iTorque 2D may not be the best choice for the task. If you want a pure zoom-pic app, iT2D is overkill. It's a game engine.

I have heard two separate recommendations that might be more appropriate:

1. Roll your own app from scratching using Core Animation/Quartz. I found some API related to CALayer and CATileLayer that might be a great starting point

2. Find a technology like Photosynth or Gigapic that can be integrated into your own application

I'm more than happy to grow our iT2D community and grab sales for the company, but that can be negated by someone purchasing the engine and realizing it cannot do what they want (thus harboring negative feelings). If you have any other questions about iTorque 2D and its capabilities, just let me know.
#3
08/04/2011 (9:28 pm)
Hi there, thanks so much for the recommendations. I should have probably been more specific - the reason I'm looking at game engines such as Torque is because I wanted to add some interactivity to the project. For example, if you open up in a desert scene, I wanted to create some touch based interactions like making plants grow, or triggering a bird animation. I wanted to incorporate a 'pinch' input to move through the image, but play around with other commands so that the images you're moving through are interactive, rather than static and visual. Would Torque still be a good option for something like that?
#4
08/05/2011 (12:29 pm)
I've been a huge fan of zoomquilts for a long time, and have pondered adding them to our adventure games (T2D)... I think it could be done. The basics of it would be as Mich said, scaling in the images and deleting them once out of view.

That said, I have NO idea how smooth you could get it on something like an iPad -- no experience there, really.

If you get it working come back and show it off!
#5
08/05/2011 (12:59 pm)
@Mags - Alright, so the features move the project a little closer to using technology like iTorque 2D. The kind of interactions you are talking about are extremely simple to set up in iT2D.

If you are looking for a decent amount of interaction and want to create reusable code, then an engine could speed you up. In fact, so far you haven't mentioned anything that is really iOS specific except for the touch system. You could try downloading the Torque 2D demo to get a feel for the editors, scripting system, asset system and rendering. The script prototype I mentioned previously would work in both T2D and iTorque 2D, so you can probably come to a decision on your own (without me pushing you one way or another).

If you try out the demo, you can ask questions in the forums to see if you can get something workable running. This is probably the best way to make a decision if iTorque 2D is the right tool for you. If T2D cannot handle this in script, then more research would need to happen.
#6
08/05/2011 (5:37 pm)
So.

I messed around with this a bit this evening, and I'm 100% sure this can be done flawlessly on PC/Mac with just script. It can also be done flawlessly with just script on iPad, IF your "quilts" aren't too long.

I've got this one: http://www.markus-neidel.de/zoomquilt2.html running on my iPad using iT2D, and it's pretty smooth. Dynamically loading each new datablock as you go along gives it a little bit of a slowdown, though, so preloading scenes will be your best bet. Alternately, with some source changes, perhaps a piecemeal background datablock-loader could allow for any number of scenes.

Pre-loading in script you can get maybe 40 scenes that size in memory before the iPad2 explodes. Not sure about iPad1... likely less though?

The odd frame-pixels issue can be resolved in art, if each image contains all of the layers below it (the zoomquilt 2 images did not... mostly black or white rectangles in the middle), and if you have at least a pixel row of partial alpha all the way around the outside (kills the white edge stuff).

My prototype used 7 images on-screen at a time, ranging from 1024 x 768 down to 16 x 12... (due to the art not containing the next layer, mostly), but with art HAVING all the layers per image and fading through the transitions, you could probably get away with 4 or even 3. Possibly 2 even, based on what you need.

Scale 'em up based on a scaling factor tied to pinch controls, and you're good to go.

Also... side note as I just learned this today my first time messing with iT2D -- iT2D doesn't like progressive jpgs. Caused me at least 45 minutes of debugging my code to find that it was the stupid image. :|

OK that was long... but that's what I learned this evening obsessing over zoomquilts on iT2D.

Best of luck!

-Tim

#8
08/06/2011 (8:11 am)
@Tim - Very nice. Quite impressive how quickly you pulled that together

@Mags - There you have it. iT2D handles the base functionality in script. Once you have the zooming in, it's a matter of spawning objects you want to interact with at the specified times. From there it's just a matter of determining the interactivity and keep an eye on performance.
#9
08/08/2011 (7:04 am)
Tim and Michael, thanks so much both for your comments and help. Tim, it's great you got a prototype up and running so quickly - I'm going to give it a go. Thanks again!
#10
05/21/2013 (7:46 pm)
Rasteredge's image c# programme may integrate with you image zooming app, you can fullfil all of the things you are doing.