PSprite Rotate/Scale/Pivot/Vertex
Moderator: GZDoom Developers
-
- Posts: 8111
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
PSprite Rotate/Scale/Pivot/Vertex
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.
Allows for modders to change the scale and rotate weapon sprites around an adjustable pivot point.
All information is available on the PR itself.
-
- Posts: 8111
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: PSprite Rotate/Scale/Pivot/Vertex
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.
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.
-
- Posts: 8111
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: PSprite Rotate/Scale/Pivot/Vertex
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.

I'll be uploading mine when I return home tonight.
-
-
- Posts: 17367
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: PSprite Rotate/Scale/Pivot/Vertex
Spoiler: Camera shake/motion sickness warningHere'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 warningAnd if you're curious - here's the script output. Warning: it's massive

Spoiler:
Last edited by Nash on Tue Oct 20, 2020 5:35 pm, edited 1 time in total.
-
- Lead GZDoom+Raze Developer
- Posts: 48657
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: PSprite Rotate/Scale/Pivot/Vertex
It might be more impressive if it wasn't shaking this madly. It's hard to look at, unfortunately. 

-
-
- Posts: 17367
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: PSprite Rotate/Scale/Pivot/Vertex
Ah, sorry about that. :P The camera animation component is optional.
Here's the same thing without the camera shake. :D

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

-
- Posts: 776
- 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
Re: PSprite Rotate/Scale/Pivot/Vertex
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.
-
- Posts: 8111
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: PSprite Rotate/Scale/Pivot/Vertex
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.
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.
-
- Posts: 776
- 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
Re: PSprite Rotate/Scale/Pivot/Vertex
This is good work MC, I hope it gets added.
-
- Posts: 8111
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: PSprite Rotate/Scale/Pivot/Vertex
Thank you. Me too, it'll make things a lot easier with some of the things I have planned.
-
- Lead GZDoom+Raze Developer
- Posts: 48657
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: PSprite Rotate/Scale/Pivot/Vertex
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,

I only checked for coding issues but didn't see any,
-
- Posts: 3428
- Joined: Sun Oct 19, 2014 6:45 pm
- Location: Plahnit Urff
Re: PSprite Rotate/Scale/Pivot/Vertex
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!
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!

-
- Posts: 8111
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: PSprite Rotate/Scale/Pivot/Vertex
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.
I hope it's not too difficult to work with as it is.