Using CSS Mask Transition with A-Frame sky entity - animation

I'm working on a school project and we are developing an interactive story with the A-Frame framework. The idea is to visit your old house and to have memories about good old times. So we're using 360° images in sky entities and we're switching those images between present and past.
I'm working on the transition when switching images, but the only good transition I can develop is a simple fade to black... My idea would be to get something similar to CSS Mask Transition here : https://tympanus.net/Tutorials/CSSMaskTransition/
Is it in any way possible to get a similar result ?
If not, would you have any idea of a good and easy transition that I could do ?
Just so you know, I'm not used to web development, we only have 3 days to finish this experience and I'm completely new to the A-Frame framework (I've been working on it for 3 days now only).
Thank you very much for you time and have a nice day !
Augustin.

A transition similar to that will be pretty involved to implement, I don't think it is possible in the span of a couple days with not much graphics experience. You'll mostly likely need to write your own shader that changes the alpha value of each pixel. Or you can maybe create an alpha map GIF or video, and use that to control the alpha values of the texture.
A-Frame has an example for transitioning between 360 images. For better performance, you have one image, do a fade to black, swap out the image, and fade back out: https://github.com/aframevr/360-image-gallery-boilerplate

Related

Using game engines for animations

I am new to animation world.I intend to make short animation films. I have started learning blender and have grasped modelling, rigging and rendering concepts. Recently I found out that game engines(unity, unreal) can also be used for animations.
Should i switch to 'unreal' instead as I can learn only a single tool over a period of time?
Or would blender be enough to make good quality animation?
Please suggest a complete animation tool for a beginner.
There is no point in making short films in game engines , if you want to make short film that users interacts with it somehow like a visual novel or where users input will matter in story then you should use a game engine because it is considered a game , but if you just want to make a short film then just use animation tools no need for a game engine because you don't need real time rendering in animations then you can get a far better rendering output by not using game engines and for animation tools there are plenty of them to use these are my personal suggestions
Maya+vray animation , rendering
mari , substance painter&designer texturing
Zbrush modeling
unity is capable of rendering each frame of animation in a second with almost the same quality that you would achieve with offline renting using vray or arnold for example , but using them each frame would take around 15 minutes that is
a 10 min animation needs about 3 months full time rendering
that's why I personally never use anything other than a game engine for short animation
but I use offline rendering when one frame is intended though

Best low level canvas library for making interactive animations?

I'm evaluating canvas libraries, and my needs are:
I want to make it easy to build nice looking buttons that move
around and on which I can easily capture events. Button drawing
helpers would be cool
I'll be building a system for others to use to create animated
scenes combining moving test, images, and sound. I won't ever be
drawing complex shapes myself, the most I might be drawing is
buttons around some text.
I do not want to be totally insulated from the low level machinery
of the per-frame drawing callback. Helped along sure, but
I'm going to be syncing with Web Audio API stuff and want to keep
access to super tight timing control
I'm comfortable with pretty low level scripting of animation, would rather not have it be something that changes Canvas into some
totally different paradigm, but not sure on this point
needs to work well for touch on iOs
I'd ideally like to be using one with good docs and a high truck number. The state of Canvas libs reminds me of the state of JS libs
10 years ago, and I'd rather not invest in something that doesn't
have an actual "team" behind it. Truck number == 1 worries me.
You flagged KineticJS, so I can say a little bit about how that would work.
1) It's a great tool for tracking shapes on a canvas, capturing clicks, and moving them around. It's easy to place an image on any shape, but I would use another program to make those images.
2) Even if you don't do a lot beyond buttons, KineticJS provides some nice features for manipulating the canvas, and I'm sure you'd use a lot of them in making tools for others.
3) KineticJS provides an animation object that repeatedly calls the draw() method for you. You define your draw method in order to create animations.
4) It's more of a wrapper around canvas. You work with a Stage and Layers, but there is still a lot of transparency to the canvas itself, and you can always do direct manipulation as well.
5) You can capture a broad range of events including "touch", "click", etc. It's easy to treat them the same when appropriate or differently if you need to. Furthermore, you can simply mark shapes as "draggable" and it handles all that appropriately.
6) Kinetic has had spectacular documentation and examples, but in looking now, the tutorials seem to be missing from http://kineticjs.com/ and I can't find them elsewhere. That's minorly worrisome, but the docs are still there and my guess is that they'll be back up soon since KineticJS is still under active development.
I'll weigh in on #1:
Nice looking buttons:
Hands-down...use Adobe Illustrator to create a set of button vector images (.svg).
If you need low level control over the button design at run-time then convert the Illustrator images to canvas drawing commands with this great plugin from Mike Swanson:
http://blog.mikeswanson.com/post/29634279264/ai2canvas.
The key here is that canvas will scale the vector button for you so you're always getting a professional, polished look both on a small mobile screen and a large desktop screen.
You could use canvas to build each part of a button from scratch, but don't reinvent the wheel.
A good animation library is Greensock. It also helps you build timelines (kind of like Flash timelines).
http://www.greensock.com/gsap-js/
As to canvas libraries, check out Stackoverflow's sister site that offers software recommendations:
http://softwarerecs.stackexchange.com
Good luck with your project!

Display many thousand images in three.js

I have up to 200'000 individual images in a scene (done with sprites, so far). I want to look at these sprites, and when I fly around they should always face the camera (as sprites do).
My question is: How can I achieve the best performance WebGL-wise? Are Sprites with useScreenCoordinates:false rendered as with GL_POINT?
At the moment the fps drops with very low image counts already. I'm using mipmapping and sprites so far. And since they need to turn around to face me I didn't want to use BufferGeometry..
I'd highly appreciate some ideas and inputs :) Thanks!
PS: Point of it all is that you can "fly" through 200'000 images and stop/select the ones you figure to be interesting
My team needed to accomplish this too, and sadly Doidel's notes trail off before the project is completed. We developed PixPlot, a three.js visualization layer for images:
I put together a blog post outlining the details here: http://douglasduhaime.com/posts/visualizing-tsne-maps-with-three-js.html
In short, if others face this problem, you'll want to create one geometry (ideally) with one large image atlas (a single jpg of size 2048px by 2048px containing lots of smaller images) serving as the texture for the geometry. Add vertices, faces, and vertexUV's for each of the little images to display, and pull each image from the atlas texture.
Used tons of techniques and stuff, I'll be writing about it on http://blogs.fhnw.ch/threejs/ once I got it all working

Should I use HTML5 Canvas or CSS3 Sprites to animate objects for a game?

I'm in the process of starting to build a strategy game (think warcraft) for the web. I've been doing research on HTML5 Canvas and CSS3 sprites and still can't decide which technology to use.
The game won't be completed for another 6 months.
Any advice would be appreciated.
As you probably hear so frequently... "It Depends..." ™
My suggestion would be consider the feel of the application you're after. If you are trying to build a very graphically rich, mostly-images application, then I would use Canvas. However if you are trying to animate some graphics, but have the page remain and behave more "Web-like", mixed with other HTML content, I'd give CSS3 a try.
Two additional points:
Currently, Canvas is better supported than CSS3 animation/sprites.
If you use Canvas you're going to be implementing your own render loop and animation code (or making use of a 3rd partly library). Your code create animation by compositing the various layers of each frame, applying movement, and repeating. You can't simply say "move this image a little to the right". You'll have to do that yourself.
The EA web game "Lords of Ultima", as dull as it is, is an excellent example of a WarCraft-styled (well, it's more city building as there are no visible units) overworld, with animations and everything, built on a pure HTML and CSS sprite base. It looks and performs well and I think the square block box-model nature of HTML suits that kind of tile based design, especially since a lot of the image processing (embed an <img> or a <div> with a background, change background-position for animation) and click/mouse handling is done for you in simple html.
If you do go canvas you have to manage that yourself which will greatly increase the complexity and dev time. You'll have more control of minor elements and improved performance, but then you'll also lose (if it's at all important), greater backwards compatibility with older browsers. So it depends on how complex your design is and what kind of performance you need.
Use Canvas. If you use CSS sprites to build a game, then you are going to make a lots of <div>'s which performs operations on the DOM, which may slow down and also have a lots of focus and compatibility problems.
It may pay off to trade the development time for performance on <canvas>, by the assumption of "A code will be maintained forever".
I think CSS3 sprite system takes more time to develop, because you need to handle browser compatibility.
Browsers like IE 8 (8 or 9?) are using GPU to accelerate graphics, which lets you get the free lunch of Moore's Law.
There's pros and cons to both. Currently, Canvas is better supported then is CSS3, but you said that your game won't be done for another 6 months, by then the support for CSS3 could be much much better. There's also a lot of other variables here, such as: What browser will the game be viewed on? How advanced are the graphics you need to animate? etc... I would say that canvas would be better for support of the current generation of browsers and for gaming graphics, however CSS3 would be quicker, but wouldn't even come close to the support or graphics handling. But it doesn't seem like your in a rush to get it done.
Basically:
Canvas: Graphics, current support in users browser
CSS3: Speed of development
Ether will work. But for now I would use Canvas. However, 6 months in the tech world is an eternity, things could be a lot different then.

Hierarchical animations in DirectX and handling seperate animations on the same mesh?

I have a hierarchical animated model in DirectX which loads and animates based on the following DirectX sample: http://msdn.microsoft.com/en-us/library/ee418677%28VS.85%29.aspx
As good as the sample is it does not really go into some of the details of animation that I'd like. For example, if I have a mesh which has a running animation and a throwing animation as seperate animation sets how can I get the throwing animation to occur for bones above the hip and the walking animation to occur for bones underneath the hip?
Also if I wanted to for example have the person lean left or right would I simply have to find the bone for the hip and multiplay a rotation matrix by its matrix? In this case I think the matrix is m_amxBoneOffsets?
Composing multiple animations to a single one is usually the job of an animation system, something that is way out of scope of the D3D sample.
Let's look at your 2 examples:
running and throwing
Well, in this case you could apply the animation for the lower part of the body from the running animation and the animation for the upper part of the body from the throwing animation. And you'd get a very crappy result.
The how is just a matter of knowing which bones are where in the bone palette (something that depends on how they are stored, and in which order, but nothing inherently hard. The definite reference should be the documentation of the tool generating the animation data)
In practice, you're better off with a blending of the 2 animation. This is, in general, is hard, and software packages exist out there that do this for you. Gamebryo, e.g.
Or, an animation of a running guy who throws is different enough from a standing guy who throws that you might be better off having 2 animations.
Leaning
If you apply a rotation matrix to the root bone, you'll simply rotate your whole character.
Now if you rotate the next bone in the hierarchy (from the spine), you'll get all the bones that depend on it to rotate likewise. It will probably do what you want, but there's a sure way to find out. Try it!
Well the thing is the running animation SHOULD affect the throwing animation slightly. What you need to look into is animation blending.
I'm sure Valve wrote a good paper on how they implemented it in Counter-strike many years ago. Its not on the valve site though so I'm not sure where I got this memory from ...

Resources