Page 1 of 1

[1.1.4 (r131M)] Model Rotation Skipping Bug

Posted: Sun Jul 13, 2008 22:11
by Slasher123
As discovered in this thread, the models in my project rotate, all at different speeds and directions, but a strange skipping can be observed.

Download the zip in that thread with the pk3 and the demo that shows this skipping bug.

All I know is that commenting out ALL the Rotation-Speed lines from the model definitions eliminated the skip.


EDIT: My system info:

Microsoft Windows XP Professional Service Pack 2
AMD Athlon(tm) 64 X2 Dual
Core Processor 5600+
2.80 GHz, 2.00 GB of RAM

Posted: Fri Jan 02, 2009 17:00
by Torr Samaho
Fixed. In gl_models.cpp replace

Code: Select all

	if( smf->flags & MDL_ROTATING )
	{
		float offsetAngle = 0.;
		const float time = GetTimeFloat()/200.;
		offsetAngle = ( (time - static_cast<int>(time)) *360. );
		gl.Translatef(smf->rotationCenterX, smf->rotationCenterY, smf->rotationCenterZ);
		gl.Rotatef(offsetAngle*smf->rotationSpeed, smf->xrotate, smf->yrotate, smf->zrotate);
		gl.Translatef(-smf->rotationCenterX, -smf->rotationCenterY, -smf->rotationCenterZ);
	}

by

Code: Select all

	if( smf->flags & MDL_ROTATING )
	{
		float offsetAngle = 0.;
		const float time = smf->rotationSpeed*GetTimeFloat()/200.;
		offsetAngle = ( (time - static_cast<int>(time)) *360. );
		gl.Translatef(smf->rotationCenterX, smf->rotationCenterY, smf->rotationCenterZ);
		gl.Rotatef(offsetAngle, smf->xrotate, smf->yrotate, smf->zrotate);
		gl.Translatef(-smf->rotationCenterX, -smf->rotationCenterY, -smf->rotationCenterZ);
	}

Posted: Fri Jan 02, 2009 19:24
by Graf Zahl
That only fixed one of the 2 modes but it was easy enough to transfer to the other one, too.

Posted: Sat Jan 03, 2009 3:18
by Slasher123
Wow, I had completely forgotten about this problem. The project I was working on that experienced this problem has been on hold for a long time.

Is this fixed now?

Posted: Sat Jan 03, 2009 14:17
by Enjay
Slasher123 wrote:Is this fixed now?
It should be (thanks Graf and Torr). The changelog for r283 says it has been done. I'll get a build online in a few minutes.

[edit] Wait, Graf has just committed r284, I'll rebuild and put that up instead. [/edit]

[edit2] It's up and it does indeed seem to allow your test map to play without the model skipping problem. [/edit]

Posted: Sat Jan 03, 2009 16:15
by Torr Samaho
Graf Zahl wrote:That only fixed one of the 2 modes but it was easy enough to transfer to the other one, too.
I think you forgot to multiply time with smf->rotationSpeed in the second mode.

BTW: In case your email notification for PMs here is still broken, please check your inbox.