Undesirable behaviour for DrawScaleform native

Rotation “Flipping” Issues

After pulling out most of my hair, I’ve realized my rotation issues while rendering a scaleform using the DrawScaleformMovie_3dNonAdditive are related to how the native is dealing with rotation.

My best attempt at giving an example:

Using the DrawScaleformMovie_3dNonAdditive function, the scaleform frame seems to “flip” at “random rotations”. I’m raycasting to get the projection point, and using the normal to calculate the scaleforms direction.

Here is an example of the rotation before the “flip”.
Here is an example of the rotation after the “flip”. Note the similar normal/rotation values.

Opting instead to use the DrawScaleformMovie_3d function instead, I found the rotation never had a circumstance in which it “flipped”, though the initial rotation offset was different (likely preferable).

Here is an example of the rotation before the “flip”.
Here is an example of the rotation where NonAdditive would cause a rotation flip unexplainably. Note there is no rotation flip using this method.

More issues with DrawScaleformMovie_3dNonAdditive

Aside from the rotation issues, the LUA variant of this function seems to render with an undesirable “stretch” effect, where the same function (using the same arguments) in JS does not.

Here is the undesirable stretch effect caused by calling this function in LUA.
Here is the desired effect.

1 Like

Can you actually provide code for each scenario so that it’s easier to look into? Some of it may be float/int conversion stuff, but I also recall the two ‘3d draw’ calls had different handling of coord/rotation->matrix conversion for some reason (likely R* using them in different ways).

Sorry- that should’ve been the first thing I uploaded.
I’ll extract a testable portion showing exactly this problem and send it tomorrow.

Thanks for the reply.

Sorry for the late response:

Managed to boil down this issue down to the 8th argument in DrawScaleformMovie_3dSolid. Can ignore this portion.

The rest (“flip”) seems to cause issues when I attempt to add to the scaleform rotation vector.
Test this by:

/testpanel time [5000-10000] addRotation [0-1]

The command should place you near the sprunk machine in mission row PD, same as where I shown in my examples. Recommend running once without addRotation, and once with.

Thanks again :slight_smile:

test_panels.zip (4.4 KB)