HOME | DD

MisterAibo — Tumblr Tutorial 5: Clouds (Interactive)

Published: 2012-09-24 16:21:43 +0000 UTC; Views: 8961; Favourites: 115; Downloads: 2008
Redirect to original
Description Download the SVG for the tutorial.
Should work on pretty much anything expect IE. I advise using Chrome.

The file is a bit larger than you would expect. Since there is no loading bar, you might have to wait a few moments, depending on your connection.

This tutorial is a part of my Ask the Professor Tumblr weblog. You should probably take a look there if this interests you.

Any thoughts on this are appreciated, as always.

--- Note
I actually have a half-finished fully interactive cloud - you click an object, it shows you outlines, gradients, nodes and all of the other useful things. I might finish it if people would like me to.

--- Idea
I really wanted to try out animated interactive SVG as a presentation platform to use in school. I was also doing some research into viewBox, which works as a "camera" of sorts. Moreover, the tumblr has some problem with wide images. I wouldn't want people to have to use the scroll bar.
One last thing was that while most of my tutorials go from top to bottom, this one turned out going the other way. Which is pretty hard to do unless you want to pull the whole "read from bottom to top!" thing. Which I don't.

--- Technical
The basic image looks like you would expect it to. Open it in inkscape to see the whole thing. The transitions are made by animations, which change the viewBox attribute through time. This allows the image's point of view to shift, even zoom in and out. Each animation is triggered by clicking the button, which calls an ecmascript (kinda like javascript, much easier to use, less options though) function that uses the even's id as a clue to which animation should be started. Since the animation uses freeze fill and other animations go from same viewBox position, you won't notice the animation's end.

--- Thoughts for next time

ecmascript is somewhat limiting, so I can't - for instance - have the tutorial work with keyboard keys for navigation. Also, I adress a frame directly by doing something like "tutorial.svg#chapter9".
Solution: using javascript instead, but ecmascript is much less complicated when it comes to the things I usually need.

The transition animation seems to be a bit jerky on Opera and Firefox. This is probably because of the splines I use instead of linear timing.
Solution: don't use splines. But I just really like the feeling it has. Not to mention that linear timing actually jerked a bit in Chrome. Peculiar.

The few (two) bitmaps that are included jerk during the transitions as well.
Solution: try not to use bitmaps. Vector the whole of inkscape interface in future.

For an "interactive" SVG, this one is not that interactive. It's basically just a presentation front-end.
Solution: stop being a lazy bastard and make something spectacular. (Will do in the animated tutorial about animation.)

The interface could use some cleanup. It looks like it was made in 1990s.
Solution: stop being a lazy bastard.

--- Premium Content
The premium content includes the same SVG as the download. By paying for the premium, however, you would support my other animation/interaction/tutorial endeavours. For which, I would be eternally grateful. It's not that much anyway.

--- Time taken
Image: 2 hours
Text: 1 hour
Interface and animation: 4 hours
Debugging: 2 hours
Related content
Comments: 41

AmbitiousGemOfLost [2017-09-15 07:13:53 +0000 UTC]

howdo you even open an svg file? I cant open those in flash o.o

👍: 0 ⏩: 0

babyroxasman [2016-05-30 23:19:19 +0000 UTC]

Wait, so you can animate with inkscape?

👍: 0 ⏩: 1

MisterAibo In reply to babyroxasman [2016-05-31 00:50:51 +0000 UTC]

Not inkscape directly, but SVG format has full animation capability. Inkscape doesn't have the proper tools, which is why I made my own editor for it - I'm currently working on a major update. SVG animation is supported by major browsers, and can, of course, be exported into any other format. All animations I made are done with SVG.

👍: 0 ⏩: 1

babyroxasman In reply to MisterAibo [2016-05-31 02:43:17 +0000 UTC]

Okay cool, also your tutorials helped me out so thank you!

👍: 0 ⏩: 1

MisterAibo In reply to babyroxasman [2016-05-31 04:13:09 +0000 UTC]

I'm glad to hear that. :3

👍: 0 ⏩: 0

CheetahDeathHeart [2015-04-11 20:54:17 +0000 UTC]

take a deep breath 
2. think of someone you like
3.press F10 5 times
4.send this to 5 other comments 
5. look at your backround

👍: 0 ⏩: 0

sistemx [2013-04-25 00:19:13 +0000 UTC]

shape = document.getElementsByTagName("svg")[0];
shape.setAttribute("viewBox", "-7000 -7000 9500 8050");shape.setAttribute("width","9000px");shape.setAttribute("height","9000px");

!!!

👍: 0 ⏩: 1

MisterAibo In reply to sistemx [2013-04-25 00:38:11 +0000 UTC]

Well, yes. How did you think it worked? It's a bloody large image.

👍: 0 ⏩: 0

ShyneLight [2013-02-22 14:23:48 +0000 UTC]

Click download file to receive Joy!

HarHarHar!

👍: 0 ⏩: 0

meldoymoon [2013-01-10 20:44:03 +0000 UTC]

I wish I could bye this

👍: 0 ⏩: 1

MisterAibo In reply to meldoymoon [2013-01-10 20:54:42 +0000 UTC]

Technically, you don't need to. The premium SVG is just a way for me to make a few points on the side - the file is identical to the regular download.

👍: 0 ⏩: 0

FlyingGekko774 [2012-12-27 14:43:37 +0000 UTC]

My word, this makes so much more sense and things so much easier!
Thank you for this amazing tutorial!

👍: 0 ⏩: 1

MisterAibo In reply to FlyingGekko774 [2012-12-27 17:45:25 +0000 UTC]

No problem. I always enjoy sharing knowledge.

👍: 0 ⏩: 0

Soren-the-Owl [2012-12-16 03:25:50 +0000 UTC]

for some reason, i cant find the shape option called "from clipboard"

👍: 0 ⏩: 1

MisterAibo In reply to Soren-the-Owl [2012-12-16 03:27:29 +0000 UTC]

Can you see the other shape styles? Triangle in, triangle out? Do you actually have some shape in the clipboard? Can you send me a snapshot?

👍: 0 ⏩: 1

Soren-the-Owl In reply to MisterAibo [2012-12-16 03:40:12 +0000 UTC]

i dont see a shape option on inkscape

[link]

👍: 0 ⏩: 1

MisterAibo In reply to Soren-the-Owl [2012-12-16 03:45:11 +0000 UTC]

You have to use one of the tools - like the curve tool. Then, the shape option will be located in their context menu like so: [link]

👍: 0 ⏩: 1

Soren-the-Owl In reply to MisterAibo [2012-12-16 03:47:16 +0000 UTC]

Do'h

/)_-) silly me.... thanks a lot haha

👍: 0 ⏩: 1

MisterAibo In reply to Soren-the-Owl [2012-12-16 03:49:30 +0000 UTC]

No problem - have fun with inkscape. It's always nice knowing something new, isn't it?

👍: 0 ⏩: 1

Soren-the-Owl In reply to MisterAibo [2012-12-16 03:57:49 +0000 UTC]

hahah indeed! i just need 1 more vector to actually be a member of the club haha. i have gotten 3 accepted into their folders ^_^

👍: 0 ⏩: 1

MisterAibo In reply to Soren-the-Owl [2012-12-16 03:58:46 +0000 UTC]

That's nice. Back when I started, they didn't have these rules. It was just a small group that had a few members. Sometimes, I miss those days.

👍: 0 ⏩: 1

Soren-the-Owl In reply to MisterAibo [2012-12-16 03:59:49 +0000 UTC]

i wonder how long the group has been running?

im only 15 XD

👍: 0 ⏩: 1

MisterAibo In reply to Soren-the-Owl [2012-12-16 04:07:34 +0000 UTC]

A bit over a year and a half now. I've been actively publishing pony pictures on dA about two months before that and elsewhere even before that. I wasn't there when the show started, but I think I was there when there were fewer than six episodes out.

I've done this for a while and if you take a bit and look through my gallery, you'll see that I've learned a lot. Anyone can. That's why I want to help others to do just that. Because it feels great to be able to look back and see the journey you've made.

👍: 0 ⏩: 1

Soren-the-Owl In reply to MisterAibo [2012-12-16 04:25:10 +0000 UTC]

haha i love that feeling! i still have old exports of vectors i first made, and i love comparing them to the ones i have now ^_^

its makes me feel all fuzzy inside when I look at that.

👍: 0 ⏩: 0

Poison--Hearts [2012-10-02 04:23:31 +0000 UTC]

Hey I remember you I still appreciate that little fix you did with me.. still have never had that happen again. Also nice tutorial. Its weird, Adobe AI is a lot different Than Inkscape. I Enjoyed looking through all of it though. ^^

👍: 0 ⏩: 1

MisterAibo In reply to Poison--Hearts [2012-10-02 10:07:59 +0000 UTC]

Sure there are different, but they both have their merits. It's just a question of which one you prefer.

👍: 0 ⏩: 0

Warhammeristka [2012-09-26 05:34:05 +0000 UTC]

Thank

👍: 0 ⏩: 0

Warhammeristka [2012-09-26 03:51:50 +0000 UTC]

Спасибо,а урок по рисованию облаков очень понравился. Жаль у меня нет этой программы

👍: 0 ⏩: 1

MisterAibo In reply to Warhammeristka [2012-09-26 03:58:13 +0000 UTC]

I'm glad you liked it. You can actually download inkscape for free , so there's no reason not to try making a few vectors like that yourself. It might even be available in your language.

I actually find drawing clouds really relaxing.

👍: 0 ⏩: 0

Warhammeristka [2012-09-26 03:45:23 +0000 UTC]

Я из России,и плохо говорю на вашем языке

👍: 0 ⏩: 1

MisterAibo In reply to Warhammeristka [2012-09-26 03:48:33 +0000 UTC]

Well, English isn't my first language either, so I understand.

👍: 0 ⏩: 0

Warhammeristka [2012-09-26 03:41:09 +0000 UTC]

Thank

👍: 0 ⏩: 1

MisterAibo In reply to Warhammeristka [2012-09-26 03:42:00 +0000 UTC]

Welcome

👍: 0 ⏩: 0

tamalesyatole [2012-09-24 20:24:02 +0000 UTC]

That was really informative! I would repeat what ZuTheSkunk just said but that would be redundant. The only disadvantage I can think of, is that I would need to draw and copy a different Shape every time I need a different stroke thickness. Never mind. This is incredibly far more useful to do the streaks on wood.

And I personally prefer the "Long Picture" format in a tutorial, so I can easily go back with a few PgUp presses

👍: 0 ⏩: 1

MisterAibo In reply to tamalesyatole [2012-09-24 20:35:31 +0000 UTC]

I'm kinda toying with both, but this format can allow me utilise things like optional examples, branching tutorials and less confining format. I'm currently working on a way to implement keyboard controls - with arrows - which would make things much more useful. Longer tutorials would probably include a "scene list" like DVDs, or maybe thematic chapters. If I'm able to use all of the above, this should be better than the stripes.

👍: 0 ⏩: 0

mattyhex [2012-09-24 19:50:41 +0000 UTC]

I'm impressed, and I must say all the animations were smooth for me (on Opera,) but then my computer is pretty powerful.

I'm not aware of any differences between ECMAScript and JS, as far as I'm aware (and tried) JS is ECMAScript - and this idea that you can't capture keyboard actions is incorrect, I've got an SVG file to do that (you can find it here , it does use a third party lib, but it captures keyboard input.) And I'd recommend using a counter to denote which 'frame' the user is on, rather then pulling that from the event ID.

Are you using some form of program to make your animations in? I do want to do more, I just hate having to deal with straight XML and guesswork to figure everything out.

I also learned about making clouds efficiently, go figure.

👍: 0 ⏩: 1

MisterAibo In reply to mattyhex [2012-09-24 21:06:07 +0000 UTC]

Well, I'm not really sure, but some of the syntax is a bit different. From what I can gather, ECMAScript is a bit like cut down version of JScript, but a bit more useful. For instance, the handling of events - like I use for the navigation - is simpler to do than the JS catching one would have to do. I'll think about the lib, but really, I like to do these things myself. I like to know what makes them tick.

I make the animations in the XML, so you're out of luck. But there's no guesswork included - I used a simple 600x800 rectangle as a viewbox base, grouped and moved around its group duplicates to the positions I'd like the camera to go through. That gave me the translation coordinates I then used in the animations. The active parts of the buttons are just duplicates of the circles, which weren't hard to make either. The only thing I didn't expect was that the group itself can't be clicked - you can see the remnants of the IDs in the code.

As for a frame global variable, I thought about it, but... well, this seemed more natural to me. I guess if you made it your way, you'd only have to make the interface once - one button to increase the ticker, one to decrease. And once for the last frame. Which makes more sense when I look at it... But then, you would have to include a way to work go back. You can't simply call the animation in reverse, so it would have to be something like odd numbers for back, even for forward, increase by two when forward, decrease by one, animating and decreasing by one when going back. I'll use that next time. (Self-brainstorm is the best.) Thanks for the tip.

Why don't you like XML? It's really well structured...

👍: 0 ⏩: 1

mattyhex In reply to MisterAibo [2012-09-24 22:23:11 +0000 UTC]

The easiest way that I can think of is to write either one or two functions, a way to increment the counter and a way to decrement it. When you increment it you play the forward animation, say "0_to_1" - could be coded as:
getElementById(counter + "_to_" + ++counter);
and when you decrement it you play the reverse, "1_to_0" - similarly:
getElementById(counter + "_to_" + --counter);.
Of course you'd still have to write each animation like you have now, but the only things you have to look out for are when the counter reaches 0 and the total number of animations available. Doing such condition checking would probably lead to code along the lines of:
function getAnimId(increment) {
 if(increment) {
  return "anim_" + counter + "_to_" + ((counter + 1 > FRAMES) ? counter = 0 : ++counter);
 } else {
  return "anim_" + counter + "_to_" + ((counter - 1 < 0) ? counter = FRAMES : --counter);
 }
}
(That code works on Opera, I can't guarantee anything else though.) Where FRAMES is specified somewhere as the total available animations.

I do like XML, it's a really nice way to pass data around. It's just that when making things happen visually, a GUI would make life so much easier (I still hope one day to make this happen.)

👍: 0 ⏩: 1

MisterAibo In reply to mattyhex [2012-09-24 22:42:54 +0000 UTC]

I know how to write it. It'd probably work even with this naming convention, since the animation IDs are animation_(current)_to_(+1 for forward or -1 for back).

And yeah, I have to make the animations. Sadly, there is no real way to pause an animation (unless you'd want to change its duration to a million years, in which case it would slow down so much nobody would notice). But that's not really a good solution, since you can't reverse the animation at all.

Just like I said - making it like this (incremental/decremental) would save me time with the interface.

👍: 0 ⏩: 0

UnimportantUsername [2012-09-24 17:10:52 +0000 UTC]

Oooh, I didn't know about the curve tool. This will prove useful! Thanks a lot for the tutorial, it was quite impressively done.

One thing though, I noticed two typos in the text, both happening when he's inside the building: "drawimg" and "cuves".

👍: 0 ⏩: 1

MisterAibo In reply to UnimportantUsername [2012-09-24 17:16:37 +0000 UTC]

Thank you - I actually found out when I was examining one of #MLP-SVG-Resources ' submissions of a cloud. I'll try to fix the typos later. (It's kinda painful - opening the thing in inkscape can delete the scripting.)

👍: 0 ⏩: 0