Vector graphics in 3D?

Software: Away3D 3.x

Tricky Widget, Newbie
Posted: 05 June 2012 11:05 AM   Total Posts: 19

I’m looking at developing for mobile devices, and the difference in screen resolution between the smallest phones and the largest tablets means that vector graphics are the smart way to go.  However, I’m finding that since Stage3D brought hardware rendering, it seems like every single 3D engine abandoned vector graphics entirely because GPUs only work with bitmaps.  So I guess I’m looking to step backwards in time and do it old school.

I need to be able to load my graphics from external files.  In digging through the docs for Away3D 3.6, I find away3d.loaders.Swf (which I would link to, but the board seems to think I’m spam), which is described as “File loader for swfs with injected vector data.”  That sounds like it is probably what I’m looking for.  Unfortunately, I can’t find much in the way of documentation on how to use it.

Can anyone give me any pointers on how to go about this?  Or suggest an alternate route for doing 3D with vector graphics?

Thanks!  smile

   

Richard Olsson, Administrator
Posted: 16 June 2012 12:31 PM   Total Posts: 1192   [ # 1 ]

Are you sure you need vector graphics in 3D space though? Textures need to be bitmaps, but you can generate those bitmaps in your code, e.g. by drawing vector graphics in a display object to a BitmapData and use that as a texture. That way you can adapt the size of your BitmapData to the size of the screen.

As far as geometry goes, you can probably use enough vertices/triangles to make really smooth shapes without having to use dynamic tessellation (which is what would need to happen if you really needed to use proper vector graphics.)

Trying to run Away3D 3.x on a mobile device is going to be really tough. It’s all CPU-based, and CPUs on some mobile devices are extremely slow compared to modern (or even decade-old) PCs. You will definitely want to try to use Away3D 4 if you’re aiming for mobile targets, since that will be able to use the devices’ relatively strong GPUs.

   

Tricky Widget, Newbie
Posted: 16 June 2012 12:40 PM   Total Posts: 19   [ # 2 ]

Thank you for the suggestion!  I wound up coming to much the same conclusion.  I’m starting with the original graphics in SVG.  Then on first run, I’m using as3svgrendererlib to render those to bitmaps which are custom-scaled to fit the device they’re running on.  Then those bitmaps are used in the normal manner with Away3D 4.0.  It’s a touch clunky, but it works.  smile

   

Richard Olsson, Administrator
Posted: 16 June 2012 12:44 PM   Total Posts: 1192   [ # 3 ]

Why SVG, instead of using Flash’s native vector capabilities? If I were you I would just create a library of MovieClips for your vector textures in Flash, and just draw instances of those MovieClips to bitmaps using BitmapData.draw().

   

Tricky Widget, Newbie
Posted: 16 June 2012 12:53 PM   Total Posts: 19   [ # 4 ]

I don’t have an editor for Flash vector graphics (I’m just using SDK + FlashDevelop).  I’m also wanting to make my program able to read in graphics that other people create (it’s a game engine), and I don’t know of a freely available editor to suggest to others.  So I’ve been using Inkscape and SVG.  But if you know of a more native solution, I’d be happy to check it out!

   

saimgee123, Newbie
Posted: 22 March 2013 08:41 PM   Total Posts: 7   [ # 5 ]

Yes no doubt vector graphic is most important in our daily life and your decision is so goo to choose the vector graphic way in development. check this url i hope this will be useful for you to learn about the vector graphic. pasta vector

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X