How to create scaleable svg animations? - animation

Consider creating an SVG animation: a rectangle move into the scene from left side of the svg image and move out from right side and this is a loop.
(And i don't what to use canvas libraries or any javascript code).
[1] Is it possible to create this simple animation with any application (just like flash but with svg export) (I know Adobe Illustrator let us export vectors but not sure about animating theme).
[2] Also as SVG is vector based i intend to make this svg animating fluid (setting the width of svg to 100% an content scale automatically) is it also possible?
(I know how to do such these things using canvas libraries like snap.svg kinetic ... with bunch of js code i'm looking for some GUI App which let a graphic designer having no idea what JS is do it like Adobe Flash for example).
Any solution?

I am not sure about GUI App but fluid animations are possible. Look at the following elements: animate, animateMotion, animateTransform, animateColor.
Here are some examples and documentation:
MDN: animate, animateMotion
W3C

Related

How to load gltf with svg texture

I am trying to load svg and use it as a texture for some parts of my 3d scene in react-three-fiber. The issue I am trying to fix is that somet of the textures are quite blurry even though I have big raster images.
I can load an svg using react-three-drei's component, and it looks super crisp.
Is there a way I can load svg as a texture for a mesh? Or should I go about it as I somehow link the component to the mesh and mimic its size and movement during animations?
Not sure how I can do this.
I've tried adding the svg files directly in my gltf file as texture with mimetype image/svg+xml but react three-fiber gives an error about enconding.
Also I've tried using useTexture() with the svg source which does work, however blurry as the raster textures.
I want to know if it is possible for me to achieve this somehow. Or if there is an alternative to making my scene render crisper.
Hi sadly textures are raster images only…
There is technique called SDF 2d but this would also involve converting svg to image…
You can check it here https://github.com/dy/svg-path-sdf
The way it works, it coverts svg to raster under the hood, for you, maybe there is some options for it, however I would recommend process your svg to png or jpg manually…

Three.js set texture to inline svg

I am not sue of this is even possible but instead of setting a texture to a jpg like THREE.TextureLoader().load('./texture1.jpg')
I want to set the texture to an INLINE SVG (I want to animate with javascript GSAP).
Is this possible? Probably not :(
Sorry, it's not. You can't use a SVG file as a texture. However, you can load SVG files in three.js via THREE.SVGLoader and then create shape meshes from the resulting path data.
But keep in mind this is a one-time operation. If you animate the SVG, you won't see any effect after the loading process.

How does one control an animated SVG in Unity 3D?

I have an animated SVG file that contains 400 frames of animation. I'd like to put this asset in my game, and control which frames playback and when like a file strip / animated GIF. I have the asset imported using SVGAssets.
Is there a way to do this? I've looked in the Unity documentation, but it continually points me at standard 2D assets or normal 3D FBX files.
Thank you!
SVG animations are not supported by SVGAssets plugin, at the moment. The usual workflow would be to import SVG static graphics with SVGAssets, then animate it with Unity tools (as done for the Orc example included in the SVGAssets package).

Add perspective to image in web

I have a squared formed image. I need to add perspective view to it and then make an animation that will restore image back to square view. This actions must work at least in all newest versions of browsers and without Flash.
I have tried to do this as follows:
Using RaphaelJS I can only clip image (create path and set fill to image url), not add perspective.
Canvas works as svg and vml in RaphaelJS... I can't add perspective with it's help.
CSS3 3D animation method rotateX adds perspective, but it is supported only by Chrome and Safary.
There is no way to add perspective to image using built in tools.
The only possible solution, I have found is using SVG add clip path to image - it doesn't add perspective view, but it's the best possible solution.
As I understand - we can use Canvas to add perspective, but you must write your own javascript algorithm to transform plain image to perspective view.

Region selection in canvas

I'm setting up an experimental html5 website using canvas.
I am drawing 3 circles all next to each other and all I want to know is how to be able to select them.
I'd like them to become links, in a way. Not tags, since everything's gonna be created using javascript.
Something like kinetic JS : http://www.kineticjs.com/, but without the extra library.
I have found some scripts that are using ghost canvas and contexts, but the examples are for dragging and stuff. I only want to be able to select my shape and execute some code.
Thank you!
I am thinking you might want to look into the IsPointInPath() method. It will help you figure out whether or not the mouse clicked on your canvas object.
See Detect mouseover of certain points within an HTML canvas?
if you are talented in xml i suggest you to use canvas + SVG (http://www.w3schools.com/svg/)
And follow this simple example.
http://jsvectoreditor.googlecode.com/svn/trunk/index.html
regarding to SVG and Canvas , the differences are obvious, as you can load bitmaps in SVG, and you can draw lines using the canvas API. However, creating the image may be easier using one technology over the other, depending on whether your graphic is mainly line-based or more image-like.

Resources