Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rectangle rotation geometry + material problems #3172

Closed
lucasvw opened this issue Nov 6, 2015 · 2 comments
Closed

Rectangle rotation geometry + material problems #3172

lucasvw opened this issue Nov 6, 2015 · 2 comments

Comments

@lucasvw
Copy link

lucasvw commented Nov 6, 2015

I made a little video in an attempt to show the problems with rectangle rotation (sorry about the music..)
https://www.youtube.com/watch?v=46xek0WHZRk

  • I made a blue square with Inkscape (png).
  • I loaded this png as material over a Rectangle and added as primitive to the scene.
  • The size of the rectangle side is 200m, earths curvature is fully negligible at this scale, so funky haversine stuff where the sum of angles in a triangle is no longer 180Degrees etc is not significant.
  • The lower left corner of the rectangle is taken from a mouseclick. The upper right corner is computed with a formula from here: http://www.movable-type.co.uk/scripts/latlong.html. Which shows the general formula for computing a second coordinate which lies at a distance and bearing from a first point.
  • This results in a correctly drawn rectangle on the 3D globe. (rotation = 0)
  • Upon rotation there can be noticed two things:
    (1) The material is not rotated correctly. this seems to be the already filed here: Texture rotation incorrect #2737. (At right angles, 90 degrees etc this error doesnt occur by the way)
    (2) The rotation of the rectangle geometry is not computed correctly, the square is skewed at nonzero rotations. This is visible at all rotations but strongest at 80 or 110 degrees. At 90 Degrees the square is not skewed (angles are still 90Degrees) but the sides are no longer identical in length. (so its a rectangle instead of a square, aspectRatio != 1).
    In 2D view the following can be added:
  • At 0 Degrees rotation the square is displayed as a rectangle (aspectRatio != 1).
  • Under rotation this non square rectangle is maintained. So although the initial rectangle under 0 rotation is not correct, when rotated this rectangle at least doesnt "change shape / warp" as is the case for 3D.

See also: #3173

@hpinkos
Copy link
Contributor

hpinkos commented Dec 7, 2016

See my answer in #3173. Rectangles follow rhumb lines so the edges will look straight in 2D and curved in 3D.
I also just submitted a fix for the rectangle texture rotation in #4725, so that should no longer be a problem. Thanks!

@hpinkos hpinkos closed this as completed Dec 7, 2016
@lucasvw
Copy link
Author

lucasvw commented Dec 8, 2016

Ow this makes me very happy! more than a year after the bug was submitted but anyway ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants