3D to 2D with Shadows at an angle

Community Forums/Developer Stations/3D to 2D with Shadows at an angle

therevills(Posted 2009) [#1]
Hi All,

I'm looking for a tool like Spriteforge which can create a 2d animstrip from a 3d model, but can add a shadow which the user can choose the direction of the light.

I know fragmotion can add shadows, but the light is always from directly overhead.

Does anyone know a tool which can go this?

Cheers!


Ross C(Posted 2009) [#2]
You could try making a little blitz app to record frames from 3d animation, and create the shadow in blitz. If create a copy of the entity, colour it black and scale it heightwise to like 0.01, and animate it the same as the main entity, that should work.


therevills(Posted 2009) [#3]
Interesting idea there Ross... I might have to try it now Max3D is out ;-)

Does anyone know where I can find some code to convert a colour into alpha when saving an image to png?


D4NM4N(Posted 2009) [#4]
You could always model a shadow and include it on the model.

The way to do this is:

- to make a copy of the animated model, rotate it upside-down so the head is furthest from the light and the feet are closest (so its pointing at the light)
-Then flatten the model in the Y axis using a world scale, not a by axis scale (so its profile is flattened vertically, not along the objects Z axis).
-Then move it into position if needed and so its slightly above 'ground level'
-This copy is then attached as another child to the main objects pivot/center.

If you need to render if SF from a isometric perspective from all directions then this may pose a problem. (as the shadow would rotate too)

I may see if this can be added somehow but i have soo many deadflines right now :(.


therevills(Posted 2009) [#5]
Another interesting idea... Thanks!

It would be great in Sprite Forge... forget your other deadlines! ;-)


*(Posted 2009) [#6]
the problem arises when the light is in a position other than overhead, if you look at real shadows they 'stretch' when the light is anywhere other than above. Scaling to .01 will be only good if the light is overhead, you will need to do a 'vertex' manipulation to 'stretch' the mesh to the desired appearance so it looks right.


D4NM4N(Posted 2009) [#7]
if you use the method i descrbe it does from any light angle as you point the copy to the light feet first, then squash it flat at that orientation (not along its length) you get the desired effect. If the light is low eg, 20 deg' then scale the copy a little longer before squashing it, however you dont need to go mad on this because a shadow thats the same length as the sprite is high, while not technically accurate will give a good enough illusion no one would really notice.