tall-solstice-92437
05/09/2023, 10:21 PMfast-xylophone-49098
05/10/2023, 12:04 AMhallowed-ocean-84954
05/10/2023, 1:10 AMmodel.appendRotation(-55.0 , new Vector4(1.0, 0.0, 0.0, 1.0));
2. Your perspective matrices look like the values are off by some indices in several places and I think not updating all the cells they need to. It was a little tricky to convert your function the way I did mine because I have one that works by defining the planes of the frustum and one that takes an FOV. So I combined them and converted them to your style.
hx
function createPerspectiveZO(mat:Matrix4, fovy:Float, aspect:Float, zNear:Float, zFar:Float):Void {
if (Math.abs(aspect - (Math.pow(2, -23))) > 0.0) {
var top = fovy * zNear;
var bottom = -top;
var right = top * aspect;
var left = -right;
mat[0] = 2.0 * zNear / (right - left);
mat[5] = 2.0 * zNear / (top - bottom);
mat[8] = (right + left) / (right - left);
mat[9]= (top + bottom) / (top - bottom);
mat[10] = -(zFar + zNear) / (zFar - zNear);
mat[11] = -1.0;
mat[14]= -2 * zFar * zNear / (zFar - zNear);
}
}
3. Your input FOV angle is converted to radians incorrectly at L310 - 45.0 * js.lib.Math.PI * 180
should be / 180
.
With these changes then I see the plane correctly laid back at an angle.tall-teacher-57409
05/10/2023, 6:16 AMhttps://cdn.discordapp.com/attachments/769686258049351722/1105740187427934259/Peek_2023-05-10_08-13.gif▾
tall-teacher-57409
05/10/2023, 1:07 PMhttps://cdn.discordapp.com/attachments/769686258049351722/1105843607119859782/image.png▾
https://cdn.discordapp.com/attachments/769686258049351722/1105843607493148682/image.png▾
tall-teacher-57409
05/10/2023, 1:11 PMhttps://cdn.discordapp.com/attachments/769686258049351722/1105844623533940798/image.png▾
tall-teacher-57409
05/10/2023, 1:15 PMhttps://cdn.discordapp.com/attachments/769686258049351722/1105845472389759096/image.png▾
tall-teacher-57409
05/10/2023, 1:16 PMrhythmic-wolf-50922
05/10/2023, 1:58 PMfast-xylophone-49098
05/10/2023, 1:58 PMtall-teacher-57409
05/10/2023, 3:39 PMhttps://cdn.discordapp.com/attachments/769686258049351722/1105881763567386825/image.png▾
rich-horse-51130
05/10/2023, 5:20 PMrich-horse-51130
05/10/2023, 5:20 PMrich-horse-51130
05/10/2023, 5:20 PMrich-horse-51130
05/10/2023, 5:20 PMrich-horse-51130
05/10/2023, 5:21 PMrich-horse-51130
05/10/2023, 5:36 PMtall-teacher-57409
05/10/2023, 6:07 PMhttps://cdn.discordapp.com/attachments/769686258049351722/1105918964082671636/image.png▾
hallowed-ocean-84954
05/10/2023, 6:19 PMtall-teacher-57409
05/10/2023, 6:21 PMtall-teacher-57409
05/10/2023, 6:22 PMtall-teacher-57409
05/10/2023, 6:22 PMhallowed-ocean-84954
05/10/2023, 6:22 PMrich-horse-51130
05/10/2023, 6:24 PMtall-teacher-57409
05/10/2023, 6:25 PMhttps://cdn.discordapp.com/attachments/769686258049351722/1105923460573691966/image.png▾
tall-teacher-57409
05/10/2023, 6:25 PMhttps://cdn.discordapp.com/attachments/769686258049351722/1105923516014018610/image.png▾
hallowed-ocean-84954
05/10/2023, 6:27 PMtall-teacher-57409
05/10/2023, 6:29 PMhallowed-ocean-84954
05/10/2023, 6:31 PM