Skip to content

Commit

Permalink
More info about rotation problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
zameran committed Mar 20, 2018
1 parent 2e776ac commit 70f270a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Assets/Project/SpaceEngine/Code/Core/Terrain/TerrainQuad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 160,11 @@ public class TerrainQuad : IEquatable<TerrainQuad>
public void CalculateTangetFrameToWorld(Vector3d center)
{
// TODO : To provide good rotation manipulation, center vector should be updated too... Rotated...
var uz = Center.Normalized();
// TODO : Introduce LocalToWorld matrix for each quad?! Maybe simply transform normals in shader?
// NOTE : Owner.LocalToWorld.Inverse() * Center - Node space.
// NOTE : Owner.transform.localToWorld * Center - Node space.
// NOTE : Quaternion.Inverse(Owner.transform.rotation) * Center - Node space.
var uz = center.Normalized();
var ux = new Vector3d(0.0, 1.0, 0.0).Cross(uz).Normalized();
var uy = uz.Cross(ux);

Expand Down

0 comments on commit 70f270a

Please sign in to comment.