You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some theoretical camera rotation implementation I haven't tested yet:
x = cos(angle) * x + -sin(angle) * y y = sin(angle) * x + cos(angle) * y note: angle is in radians, may want to use a math function version that uses degrees
This math should rotate a point around the focal point of the camera/viewplane.
I believe it would do so around the horizon, but I'm not sure.
The psuedo implementation I wrote up:
Intercept the projected road points before the polygon is rendered to the projection
Convert projected road points to coord pairs via a non mutating method
Apply the rotation math to the (x, y) pairs
Return the new points as an array
spread the array to the draw function
If that works how I think, it should rotate the road by whatever amount you want.
To finish the implementation, you'd also have to rotate the coords and angle of the sprites and adjust the rotation of the background elements.
Anyway, that's the current results of my Camera math research
The text was updated successfully, but these errors were encountered:
Hiya, Sajji here
Some theoretical camera rotation implementation I haven't tested yet:
x = cos(angle) * x + -sin(angle) * y
y = sin(angle) * x + cos(angle) * y
note: angle is in radians, may want to use a math function version that uses degrees
This math should rotate a point around the focal point of the camera/viewplane.
I believe it would do so around the horizon, but I'm not sure.
The psuedo implementation I wrote up:
If that works how I think, it should rotate the road by whatever amount you want.
To finish the implementation, you'd also have to rotate the coords and angle of the sprites and adjust the rotation of the background elements.
Anyway, that's the current results of my Camera math research
The text was updated successfully, but these errors were encountered: