Page 1 of 1

Simulated 3D sprite rotation in 2D

Posted: Mon May 15, 2017 4:46 pm
by ExPorygon
Hello, everyone. I'm thinking about migrating to LOVE from the scripting engine that I've previously worked with (Danmakufu) and have been trying to conceptualize how I might replicate certain effects that I previously achieved in it in LOVE as well.

I want to know if 3D rotation of a 2D sprite can be achieved, at least for visual purposes. This video shows the effect in question in Danmakufu. The 2D sprites appear to rotate in random directions in 3 dimensions.

I'm not looking for "real" 3D, I just want to know if 3D rotation of a 2D sprite can be faked for visual purposes and how I might go about doing that. Thanks!

Re: Simulated 3D sprite rotation in 2D

Posted: Mon May 15, 2017 11:47 pm
by Ref
Something like this?

Re: Simulated 3D sprite rotation in 2D

Posted: Tue May 16, 2017 1:12 am
by ExPorygon
Hmm, I see that this is done with by manipulating the image's x-scale and y-scale along with the rotation angle. I had thought of trying a similar method but I didn't think it would look as good as it seems to. I suppose this would be an adequate replacement but I don't believe that this is precisely accurate to what I'm used to seeing.

My brief research into the subject led me to believe that the effect that I'm seeking may require the use of vertex shaders, which I do not have much experience using.

Re: Simulated 3D sprite rotation in 2D

Posted: Tue May 16, 2017 2:57 am
by Ref
Maybe you could modify this.

Re: Simulated 3D sprite rotation in 2D

Posted: Wed May 17, 2017 4:43 am
by ExPorygon
Ah, this looks promising! I'll have to make it so there's only 1 image instead of 6, and change the axis of rotation from the middle of the cube to the texture. From studying the code, it looks like it's a bit out of my league to completely understand, but I'll do my best to work with it. I may end up posting back here for help later, though.

Thanks for the help, I'm sure this will put me on the right track!