Rotate() having issues that rotateLocal() does not

I have a super simple script that slowly rotates an object. It’s this single line of code in update():
this.entity.rotate(dt * 5, dt * 6, dt * 7);

The rotation “jitters” occasionally, every 20s or so. But if I change rotate() to rotateLocal() the problem goes away. The issue appears at the same rotation every time so it’s obviously tied to a certain combination of angles.

playcanvas.com/editor/scene/1258505
Here’s my test project, it’s completely empty except for two rotating cubes. Hit play and wait 20 seconds. What’s going on?

Hi @MrOliv,

Unfortunately I am unable to reproduce the jittering on my end. I tried in Chrome and in Firefox. with the following specs:

OS: Windows 10 Pro
CPU: AMD Ryzen 9 3900X
GPU: Nvidia RTX 2070 SUPER
RAM: 32GB
VRAM: 8GB
Resolution at Fullscreen: 1920x1080

Does you device differ greatly from mine? Could you post a video of the jitter you’re getting?

2 Likes

Thanks for taking a look!
Here’s a video. This happens for me on Chrome, Edge and Brave.
It does NOT happen on my old Pixel 3 though

My computer:
AMD Ryzen 9 4900HS
16Gb Ram
RTX 2060 MaxQ
Windows 10 Home

4 Likes

That is very strange behavior!

I wish I could help more, but with code that simple and a seemingly capable device, I’m really not sure. I tested it on a laptop I have handy with the following specs

OS: Windows 10 Pro
CPU: Intel i7-8565U
GPU: Intel UHD Graphics 620
RAM: 8GB
VRAM: 0GB
Resolution at Fullscreen: 1920x1200

But was still unable to reproduce. Are your browsers up to date, or do you have any extensions that might somehow interfere with that function for some reason?

2 Likes

Hi @MrOliv! I can confirm that I see the same behaviour on my laptop. (Intel i7-8750H CPU @ 2.20GHz, GeForce GTX 1060, 16 GB RAM).

2 Likes

Tested the project and oddly cannot reproduce.

  • Tested both in Firefox + MS Edge browsers
  • Tested both in 1920x1080 + 1366x768 resolutions

My gaming laptop’s specs:

OS: Windows 10
CPU: Intel(R) Core™ i7-9750H CPU @ 2.60GHz (6 cores)
GPU: NVIDIA GeForce GTX 1650 + Intel(R) UHD Graphics 630 (dedicated + integrated)
RAM: 32gb (originally 8gb)

2 Likes

What are the refresh rates of your monitors that have the issue?

On my computer (which is having issues) the screen runs at 120hz.
My Pixel3 (which is not having these issues) I’m guessing 60fps

As a quick test, can you change the screen refresh rate to 60 and see if you having the same issues please?

So with the screen set to 60fps, rotate() is showing the same issues, but on the other hand the profiler is still showing 120fps.

However, if I put the computer in battery save mode and force it to run slower, the profiler dives down to 60fps and the problem goes away, regardless of 60/120 fps screen setting.

I’ve managed to repro the issue by forcing a 120fps delta time here: https://playcanvas.com/editor/scene/1285029

I’m not sure what could be causing the issue here for it to go backwards on the rotation. The engine code looks sensible.

I’ve created a ticket here: https://github.com/playcanvas/engine/issues/3759

I have no idea what could be causing the problem on this one unless at very small values, setFromEulerAngles does something odd?

5 Likes