nl.knowledgeplaza.math.geometry
Class GeometryUtil
java.lang.Object
nl.knowledgeplaza.math.geometry.GeometryUtil
public class GeometryUtil
- extends Object
This class used Apache common math
- Author:
- User
|
Method Summary |
static org.apache.commons.math.geometry.Vector3D |
projectOntoXYPlane(org.apache.commons.math.geometry.Vector3D point,
org.apache.commons.math.geometry.Vector3D eye,
double z)
Create a projection of a 3D point onto a XY plane (specified by the z coordinate) as seen from an eye point. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GeometryUtil
public GeometryUtil()
projectOntoXYPlane
public static org.apache.commons.math.geometry.Vector3D projectOntoXYPlane(org.apache.commons.math.geometry.Vector3D point,
org.apache.commons.math.geometry.Vector3D eye,
double z)
- Create a projection of a 3D point onto a XY plane (specified by the z coordinate) as seen from an eye point.
For example:
// calculate rotation
Vector3D lPoint = new Vector3D(1000, 1500, 0);
Rotation lRotation = new Rotation(Vector3D.PLUS_J, Math.toRadians(50.0)); // rotate around the y-axis (0,1,0)
// 3D to 2D viewport projection
Vector3D lEyePoint = new Vector3D(0, 750, 6000);
Vector3D lPointProjectedOnViewport = GeometryUtil.projectOntoXYPlane(lPoint, lEyePoint, 0); // XY plane is on z=0
- Parameters:
point - eye - z -
- Returns:
Copyright © 2012 KnowledgePlaza. All Rights Reserved.