PSprite Rotate/Scale/Pivot/Vertex

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

PSprite Rotate/Scale/Pivot/Vertex

Post by Major Cooke »

Pull Request

Allows for modders to change the scale and rotate weapon sprites around an adjustable pivot point.

All information is available on the PR itself.
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by Major Cooke »

This submission is now complete.

I don't want to add anything else feature-wise to this PR out of fear that it may become too large for me to handle properly.

Any other features will be considered in a future PR.
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by Major Cooke »

Some folks have made a few examples already using QZDoom. If you want to share your examples, that'd be appreciated. ;)

I'll be uploading mine when I return home tonight.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by Nash »

Spoiler: Camera shake/motion sickness warning
Here's an ultra smooth, 35 FPS animation done entirely with A_OverlayOffset, A_OverlayRotate and A_OverlayScale. Unlike usual attempts at smooth animation that uses 10s/hundreds of sprites, this one uses only the vanilla sprites - just 5 in total. The smoothness comes completely from code, which is generated using my suite of animation tools for Blender called GZAnimTools:
Spoiler: Camera shake/motion sickness warning
And if you're curious - here's the script output. Warning: it's massive :mrgreen:
Spoiler:
Last edited by Nash on Tue Oct 20, 2020 5:35 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by Graf Zahl »

It might be more impressive if it wasn't shaking this madly. It's hard to look at, unfortunately. :?
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by Nash »

Ah, sorry about that. :P The camera animation component is optional.

Here's the same thing without the camera shake. :D

Image
SanyaWaffles
Posts: 809
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields
Contact:

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by SanyaWaffles »

If this is implemented in mainline GZDoom I can really use this in my projects for sure. Due to the higher res sprites on the HUD I might need to use Rotate/Scale/Pivot to animate them rather than increasing the frames.
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by Major Cooke »

Once the current submission is merged, I will re-attempt a parent system so overlays can rotate and follow along effortlessly without needing to calculate their positions since this could otherwise get very messy. Right now the only thing one has is relative offsets for the pivot, I can understand how this can make things a bit complicated for more sophisticated setups, unless you leave them at (0,0) with the offsets in SLADE and go from there.

But that'll wait until after this is added. I don't want it getting too big. The foundation is solid enough and works well as is.

Thank you Nash for posting those.
SanyaWaffles
Posts: 809
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields
Contact:

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by SanyaWaffles »

This is good work MC, I hope it gets added.
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by Major Cooke »

Thank you. Me too, it'll make things a lot easier with some of the things I have planned.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by Graf Zahl »

Added, I did not actually test this, if it wouldn't work I think the discussion here would be a bit longer. ;)
I only checked for coding issues but didn't see any,
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by DoomKrakken »

HELL. YES.

FINALLY WHAT I'VE BEEN ASKING FOR, AFTER SO LONG.

No more manual tilts in GIMP, no more TEXTURES manipulation for individual sprite frames, just STRAIGHT-UP on-the-fly tilting and scaling!

You are a god among men, Major Cooke! :D
User avatar
Major Cooke
Posts: 8176
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: PSprite Rotate/Scale/Pivot/Vertex

Post by Major Cooke »

It's not perfect. Eventually I'll develop a parent system so people can more easily make other overlays follow parent overlays and rotate/scale with it. But that's going to be tricky...

I hope it's not too difficult to work with as it is.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”