Simulated 3D sprite rotation in 2D

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
ExPorygon
Prole
Posts: 10
Joined: Tue Apr 04, 2017 1:57 pm
Location: New York, United States
Contact:

Simulated 3D sprite rotation in 2D

Post 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!
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Simulated 3D sprite rotation in 2D

Post by Ref »

Something like this?
Attachments
snowflake.love
Simple rotating flake
(7.97 KiB) Downloaded 314 times
User avatar
ExPorygon
Prole
Posts: 10
Joined: Tue Apr 04, 2017 1:57 pm
Location: New York, United States
Contact:

Re: Simulated 3D sprite rotation in 2D

Post 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.
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Simulated 3D sprite rotation in 2D

Post by Ref »

Maybe you could modify this.
Attachments
texturedCube.love
shader image rotation
(612.36 KiB) Downloaded 299 times
User avatar
ExPorygon
Prole
Posts: 10
Joined: Tue Apr 04, 2017 1:57 pm
Location: New York, United States
Contact:

Re: Simulated 3D sprite rotation in 2D

Post 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!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 201 guests