Hello Guest

Author Topic: animate a sprite on 3d object  (Read 6394 times)

mike2d

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 63
    • View Profile
animate a sprite on 3d object
« on: March 27, 2013, 08:12:14 am »
hi,

i'd like to apply an animated texture on a 3d object. how can i do that with 2dtk ?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: animate a sprite on 3d object
« Reply #1 on: March 27, 2013, 10:16:12 am »
You can't apply the texture on a 3d object, as the sprite requires UVs set up in a particular way to work properly, and this changes per frame. If you want to do this on a 3d object, then perhaps something like material offset / scale will work better. Updating UVs / positions on sprites is fine as they only have 4 positions, but 3d objects will likely have a lot more vertices, and be a lot more expensive to update.

x8105

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
Re: animate a sprite on 3d object
« Reply #2 on: March 28, 2013, 12:09:52 am »
Does this include building a 3d object out of sprites. I am currently doing this now, and Want to make sure I am not just having to redo this a ... 15th time. I had a feeling I should have done this 3d from the beginning... now I am kicking myself holding onto invested hours rather than Opening Blender, and just doing it.. a large tween set  for a expanding, collapsing, rotating and transforming front menu.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: animate a sprite on 3d object
« Reply #3 on: March 28, 2013, 12:14:52 am »
You can build a 3d object out of sprites. No problem with that.

mike2d

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 63
    • View Profile
Re: animate a sprite on 3d object
« Reply #4 on: March 28, 2013, 08:32:18 am »
ok, thanks.

x8105

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
Re: animate a sprite on 3d object
« Reply #5 on: March 28, 2013, 08:44:35 am »
I have 11 sliced sprites in layers,  a book for the player interface, 2 for the spine, 5 for pages, and 2 for the front cover inside and out, 500 wide and 600 tall.   2 for the back cover inside and out, they I believe the LOVE to HATE me, by messing with my patience. the outside panel tends to render in infront of the inside half the time. Anything special I need to consider...

Oh minor suggestion when setting up sprite slicing or anything with manipulating the vertices.. they are a pain in the ass to grab, I find myself clicking 2.... 3.... 4 time to get them to move, Maybe increase the collision detection somehow... ?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: animate a sprite on 3d object
« Reply #6 on: March 28, 2013, 09:25:07 am »
The vertex level collision detection is performed by Unity, theres not much that can be done there, but in the next update, there is an additional box drawn by tk2d to act as a grab box. This works when the sprites are flipped too :)


Put each layer in its own z.
The one closest to the camera will render on top of everything.
That should be it unless you're using a perspective camera.

x8105

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
Re: animate a sprite on 3d object
« Reply #7 on: March 28, 2013, 12:02:54 pm »
thaaaat would be it. I have 5 cameras in the scene to draw the interface, a combination of ortho and perspective, and the layer I need to have perspective .. is the book, looks like I am going to either model the interface book and use Ngui's 3d UI /shaders keeping their atlas at strict set size,I swear you and Ngui need to partner up. hammer out a few details.  Sheesh I wanted this build tested and posted last week ARGH!. I'm not frustrated I am a pirate yee land lubber!

I really do like this toolkit, PS if you need narration done for your tutorial video's I have done a few of my own and my younger brother is voice over talent.