glRotated in a PsychVRHMD function

In Psychtoolbox 3.0.16 on a Windows 10 system (Lenovo Legion) and an Oculus Rift:


For a study on VR sickness, I integrated the rotating cube demo of Dr.Scarfe, http://peterscarfe.com/rotatingcubesdemo.html in  PsychVRHMDDemo1. 

Basically, I have the user moving back and forth in a field of cubes hanging in mid-air, a bit like a starfield simulation. 


It works well, except that I would like the whole field of cubes to rotate or oscillate around the Z axis. 

So basically, I want to add the line  

glRotated(5  * telapsed, 0, 0, 1);

or glRotatef(5.1 * sin(2*pi*telapsed), 0, 0, 1)

for users who don't get VR-sick easily.


I put the line inside the iteration for each eye, outside of it... I just can't get the whole 3d field to rotate. If someone has an example of how to do it, I would be very grateful. 


Thanks in advance, 

Post full code please. Can't offer a coherent comment otherwise. 

P