Exemplo n.º 1
0
        private static List <Vector3> GenerateXYCircleVertexPositions(float circleRadius, int numberOfCircleSlices)
        {
            int numberOfCircumferenceVerts = numberOfCircleSlices + 1;
            int totalNumberOfVerts         = numberOfCircumferenceVerts + 1;

            var vertexPositions = new List <Vector3>(totalNumberOfVerts);

            vertexPositions.Add(Vector3.zero);
            vertexPositions.AddRange(Vector3Extensions.Get3DEllipseCircumferencePoints(circleRadius, circleRadius, Vector3.right, Vector3.up, Vector3.zero, numberOfCircleSlices));

            return(vertexPositions);
        }
Exemplo n.º 2
0
        public List <Vector3> GetWorldBorderLinesInFrontOfCamera(Camera camera, float distanceFromCamNearPlane, int numberOfEllipseSlices)
        {
            List <Vector3> worldExtentPoints = GetWorldExtentPointsInFrontOfCamera(camera, distanceFromCamNearPlane);

            Vector3 worldCenterPoint = GetWorldCenterPointInFrontOfCamera(camera, distanceFromCamNearPlane);
            Vector3 ellipseUp        = worldExtentPoints[0] - worldCenterPoint;
            Vector3 ellipseRight     = worldExtentPoints[1] - worldCenterPoint;

            float radiusX = ellipseRight.magnitude;
            float radiusY = ellipseUp.magnitude;

            ellipseUp.Normalize();
            ellipseRight.Normalize();

            return(Vector3Extensions.Get3DEllipseCircumferencePoints(radiusX, radiusY, ellipseRight, ellipseUp, worldCenterPoint, numberOfEllipseSlices));
        }
Exemplo n.º 3
0
 protected override List <Vector3> GenerateRenderPoints()
 {
     return(Vector3Extensions.Get3DEllipseCircumferencePoints(ModelSpaceRadii.x, ModelSpaceRadii.y, _ellipse.GetLocalAxis(CoordinateSystemAxis.PositiveRight), _ellipse.GetLocalAxis(CoordinateSystemAxis.PositiveLook), Center, _numberOfEllipseSlices));
 }