Rolling Issues
Moderator: Graf Zahl
-
- Developer
- Posts: 240
- Joined: Wed Mar 04, 2009 19:25
Rolling Issues
Sprite X15AA0, as one can see from opening this file, should be rotating around the dead center of the offset pivot instead of rotating the center of the picture itself. Even giving it a hard physical canvas of 514 x 514 didn't work unfortunately.
It's only a rolling sprite too -- that part of Nash's code I didn't touch.
Summon A in console.
When I added a tiny opaque pixel on the other end of the picture where it was all blank, it began working more properly like it should -- that shouldn't have to happen though.
It's only a rolling sprite too -- that part of Nash's code I didn't touch.
Summon A in console.
When I added a tiny opaque pixel on the other end of the picture where it was all blank, it began working more properly like it should -- that shouldn't have to happen though.
- Attachments
-
- test.pk3
- Summon A in console
- (28.83 KiB) Downloaded 56 times
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
Re: Rolling Issues
Looks like the billboarding system had been broken forever:
Of course this needs to use the pivot, not the center. I just wonder how this will affect anything older...
Code: Select all
mat.Translate(xcenter, zcenter, ycenter); // move to sprite center
...
mat.Translate(-xcenter, -zcenter, -ycenter); // retreat from sprite center
-
- Developer
- Posts: 240
- Joined: Wed Mar 04, 2009 19:25
Re: Rolling Issues
I could do some testing for you if you want. What would I use to get the pivots?
Also, if needed we could introduce another flag to toggle between using pivots and actual center.
Also, if needed we could introduce another flag to toggle between using pivots and actual center.
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
Re: Rolling Issues
The pivot is stored in x,y,z.
Feel free to test with this. I won't be able to do anything for the next week because I am on vacation.
Feel free to test with this. I won't be able to do anything for the next week because I am on vacation.
-
- Developer
- Posts: 240
- Joined: Wed Mar 04, 2009 19:25
Re: Rolling Issues
Well that was easier than expected. Just needed to remove the sprite center and add x/y/z to it, translate it, and then translate back once finished. This way, the billboarding is left untouched.
Question is though, I can see modders using either means -- from the sprite center or the pivots -- as both are useful. Should I add a flag that switches to one, or just make it the default implementation?
Code: Select all
else if (drawRollSpriteActor)
{
float xx = -xcenter + x;
float yy = -zcenter + z;
float zz = -ycenter + y;
mat.Translate(xx, yy, zz);
if (drawWithXYBillboard)
{
mat.Rotate(-sin(angleRad), 0, cos(angleRad), -GLRenderer->mAngles.Pitch.Degrees);
}
mat.Rotate(cos(angleRad), 0, sin(angleRad), rollDegrees);
mat.Translate(-xx, -yy, -zz);
}
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
Re: Rolling Issues
Both may be what's desired so an option would be best here.
-
- Developer
- Posts: 240
- Joined: Wed Mar 04, 2009 19:25
Re: Rolling Issues
https://github.com/coelckers/gzdoom/pull/57/files
https://github.com/rheit/zdoom/pull/715/files
Done. This also fixes pitch being backwards on flatsprites. (Yes, I know, a little ugly... but unfortunately, I tried other methods and they just didn't work out somehow.)
https://github.com/rheit/zdoom/pull/715/files
Done. This also fixes pitch being backwards on flatsprites. (Yes, I know, a little ugly... but unfortunately, I tried other methods and they just didn't work out somehow.)
-
- Developer
- Posts: 240
- Joined: Wed Mar 04, 2009 19:25
Re: Rolling Issues
Also, flat sprites will now disable camera facing.
Because this is problematic.
Because this is problematic.
Spoiler: Not Facing Camera
Spoiler: Facing Camera(That's basically a straight laser beam using perfectly angled/rolled/pitched sprites, which is distorted whenever camera facing is enabled.)
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
Re: Rolling Issues
For flat sprites, camera facing is flat out wrong, as the whole concept implies a specific orientation towards the world.
-
- Developer
- Posts: 240
- Joined: Wed Mar 04, 2009 19:25
Re: Rolling Issues
Agreed. It's in my commit too. Any time someone applies +FLATSPRITE it will ignore all camera facing instructions.
Anyway, how's it look otherwise?
Anyway, how's it look otherwise?