Skip to content

Instantly share code, notes, and snippets.

@beelsebob
Created November 1, 2011 08:47
Show Gist options
  • Select an option

  • Save beelsebob/1330172 to your computer and use it in GitHub Desktop.

Select an option

Save beelsebob/1330172 to your computer and use it in GitHub Desktop.
f.planes[RightPlane] = NormalisedPlane(PlaneMake(MatrixGetValue(m, 0, 3) - MatrixGetValue(m, 0, 0),
MatrixGetValue(m, 1, 3) - MatrixGetValue(m, 1, 0),
MatrixGetValue(m, 2, 3) - MatrixGetValue(m, 2, 0),
MatrixGetValue(m, 3, 3) - MatrixGetValue(m, 3, 0)));
f.planes[LeftPlane] = NormalisedPlane(PlaneMake(MatrixGetValue(m, 0, 3) + MatrixGetValue(m, 0, 0),
MatrixGetValue(m, 1, 3) + MatrixGetValue(m, 1, 0),
MatrixGetValue(m, 2, 3) + MatrixGetValue(m, 2, 0),
MatrixGetValue(m, 3, 3) + MatrixGetValue(m, 3, 0)));
f.planes[BottomPlane] = NormalisedPlane(PlaneMake(MatrixGetValue(m, 0, 3) + MatrixGetValue(m, 0, 1),
MatrixGetValue(m, 1, 3) + MatrixGetValue(m, 1, 1),
MatrixGetValue(m, 2, 3) + MatrixGetValue(m, 2, 1),
MatrixGetValue(m, 3, 3) + MatrixGetValue(m, 3, 1)));
f.planes[TopPlane] = NormalisedPlane(PlaneMake(MatrixGetValue(m, 0, 3) - MatrixGetValue(m, 0, 1),
MatrixGetValue(m, 1, 3) - MatrixGetValue(m, 1, 1),
MatrixGetValue(m, 2, 3) - MatrixGetValue(m, 2, 1),
MatrixGetValue(m, 3, 3) - MatrixGetValue(m, 3, 1)));
f.planes[FarPlane] = NormalisedPlane(PlaneMake(MatrixGetValue(m, 0, 3) - MatrixGetValue(m, 0, 2),
MatrixGetValue(m, 1, 3) - MatrixGetValue(m, 1, 2),
MatrixGetValue(m, 2, 3) - MatrixGetValue(m, 2, 2),
MatrixGetValue(m, 3, 3) - MatrixGetValue(m, 3, 2)));
f.planes[NearPlane] = NormalisedPlane(PlaneMake(MatrixGetValue(m, 0, 3) + MatrixGetValue(m, 0, 2),
MatrixGetValue(m, 1, 3) + MatrixGetValue(m, 1, 2),
MatrixGetValue(m, 2, 3) + MatrixGetValue(m, 2, 2),
MatrixGetValue(m, 3, 3) + MatrixGetValue(m, 3, 2)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment