|
|
@@ -13,9 +13,16 @@ public class Ellipse : MonoBehaviour
|
|
|
public Transform cameraYTran;
|
|
|
public Transform cameraZTran;
|
|
|
|
|
|
+ private Camera cameraX;
|
|
|
+ private Camera cameraY;
|
|
|
+ private Camera cameraZ;
|
|
|
+
|
|
|
// Start is called before the first frame update
|
|
|
void Start()
|
|
|
{
|
|
|
+ cameraX = cameraXTran.GetComponent<Camera>();
|
|
|
+ cameraY = cameraYTran.GetComponent<Camera>();
|
|
|
+ cameraZ = cameraZTran.GetComponent<Camera>();
|
|
|
particleSystem0 = GetComponentInChildren<ParticleSystem>();
|
|
|
/*ArrayList arrayList = new ArrayList();
|
|
|
for (int i = 0; i < 100000; i++) {
|
|
|
@@ -28,31 +35,41 @@ public class Ellipse : MonoBehaviour
|
|
|
this.DrawPointCloud(arrayList);*/
|
|
|
}
|
|
|
|
|
|
- // Update is called once per frame
|
|
|
- void Update()
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
//绘制椭圆的大小
|
|
|
public void setEllipseLocalScaleAndCenter(Vector3 radius,Vector3 center) {
|
|
|
-
|
|
|
this.ellipseTran.localScale = radius;
|
|
|
this.ellipseTran.localPosition = center;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- //设置camera 的观测位置
|
|
|
- float cameraOffsetScale = 1.0f;
|
|
|
public void setCameraPos(Vector3 center)
|
|
|
{
|
|
|
- this.cameraXTran.localPosition = new Vector3(center.x - 10 * cameraOffsetScale, center.y, center.z);
|
|
|
- this.cameraYTran.localPosition = new Vector3(center.x, center.y + 10 * cameraOffsetScale, center.z);
|
|
|
- this.cameraZTran.localPosition = new Vector3(center.x, center.y, center.z - 10 * cameraOffsetScale);
|
|
|
+ this.cameraXTran.localPosition = new Vector3(center.x - 10, center.y, center.z);
|
|
|
+ this.cameraYTran.localPosition = new Vector3(center.x, center.y + 10, center.z);
|
|
|
+ this.cameraZTran.localPosition = new Vector3(center.x, center.y, center.z - 10);
|
|
|
// this.cameraXTran.localPosition = new Vector3(this.cameraXTran.localPosition.x, center.y, center.z);
|
|
|
// this.cameraYTran.localPosition = new Vector3(center.x, this.cameraYTran.localPosition.y, center.z);
|
|
|
// this.cameraZTran.localPosition = new Vector3(center.x, center.y, this.cameraZTran.localPosition.z);
|
|
|
}
|
|
|
|
|
|
+ //描绘点的时候,相机大小自适应
|
|
|
+ public void setCameraSize(float magLen) {
|
|
|
+ this.cameraX.orthographicSize
|
|
|
+ = this.cameraY.orthographicSize
|
|
|
+ = this.cameraZ.orthographicSize
|
|
|
+ = magLen / 2 * 1.5f;
|
|
|
+ }
|
|
|
+
|
|
|
+ //最后绘制圆的时候,相机大小自适应
|
|
|
+ public void setCameraSize(Vector3 circleSize) {
|
|
|
+ Vector3 vs = new Vector3();
|
|
|
+ vs.x = Mathf.Abs(circleSize.x);
|
|
|
+ vs.y = Mathf.Abs(circleSize.y);
|
|
|
+ vs.z = Mathf.Abs(circleSize.z);
|
|
|
+ this.cameraX.orthographicSize = Mathf.Max(circleSize.y, circleSize.z) / 2 * 1.5f;
|
|
|
+ this.cameraY.orthographicSize = Mathf.Max(circleSize.x, circleSize.z) / 2 * 1.5f;
|
|
|
+ this.cameraZ.orthographicSize = Mathf.Max(circleSize.x, circleSize.y) / 2 * 1.5f;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public void AddAndUpdatePointArray(Vector3 addPoint) {
|
|
|
this.arrayList.Add(addPoint);
|