Search Unity

Bringing 2D images into the scene?

Discussion in 'Editor & General Support' started by milkytreat, Jan 15, 2007.

  1. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    Hello,

    Unity seems to be everything I've wanted (Flash, but in 3D)
    so Im trialling it out and really loving what it can do! Heres my question's I seem to always get stuck on when moving to 3D environments.

    Let me preface my questions - Im used to alot of (javascript/actionscirpt) programming and alot of vector graphics from flash development.

    I primarily work with 2D Vector art, I was wondering what the best(quickest and easiest) way to bring 2D art into the scene.

    In some other applications I jusst use png's and apply them to a plane.

    a) Whats the quickest way to bring 2D images into a unity scene without the need for external software (I would prefer to generate the mesh and attach a material via code rather than use external app)

    b) What would be the best way to go about animating the bitmaps(or ideally vectors graphics)?? i.e. a sequence of bitmaps displayed one after the other.

    c) If anyone knows how to get a illustrator file into 3D(Unity) as vector's(splines with material) and look just how it should I WILL BE YOUR MANSLAVE!!!!!*

    Thank-you very much! I look forward to using unity in the future

    *well maybe not manslave, but i will appreciate you
     
  2. NCarter

    NCarter

    Joined:
    Sep 3, 2005
    Posts:
    686
    If you want something like animated sprites, you can arrange your animation frames in a grid in a texture, then assign this to a material in Unity. Once you've done that, you can create a custom font object (see the Project pane) for which each 'character' is a tile from the texture. This can then be used with a TextMesh object to display one or more quads in 3D space (or 2D, if you just look from one direction). You can go on to animate the sprite by changing the character(s) in the TextMesh's text property. All of the above can be set up in Unity without requiring a separate modelling app.

    You could also make plane primitives and put textures on them, but the default plane primitive has a relatively high poly count. You might find it preferable to make a properly UV mapped rectangle in a modelling app and just reuse that with different textures for each image. Alternatively, you could use the Mesh API to create the geometry. There's also particle effects, if you want square camera-facing billboards.

    As well as the custom font trick above, you can import QuickTime movies as a sequence of frames, then set the material to use a particular frame. This works best if you can make QuickTime movies that use non-lossy compression and alpha channels (QuickTime Pro can do this).

    I might be able to dig out code to demonstrate the above if you can't figure it out.

    Unity can't do this kind of conversion automatically. I believe there are 3D apps which can import Illustrator vector art and convert it into polygon meshes, but I don't know of any off the top of my head.

    That won't be necessary, Mr Treat. :p
     
  3. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    I believe http://www.cheetah3d.com/ can do the conversion from illustrator to 3d model. Cheetah3d is pretty cheap and has a native Unity file importer.
    I would think Maya can do it too but i am not sure.
     
  4. joacoerazo_legacy

    joacoerazo_legacy

    Joined:
    Apr 5, 2006
    Posts:
    214
    Maya imports the vectors withouth materials, but, within Maya you are able to create the 3d model based on that and include the UV info within minutes )Depending on your desired model)

    Good luck
     
  5. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    wow! thank-you all so much for the responses i got alot to work with now :)
     
  6. Viking Dan

    Viking Dan

    Joined:
    Dec 21, 2005
    Posts:
    52
    I think Illustrator can save svg which Blender can import.
     
  7. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    Watch out. Splines->polygons can create a lot of polygons. You may need to run some sort of polygon decimation tool on what you end up with.