public void SetToRightOrtho() { currentView = CameraViews.RIGHT; myCam.orthographic = true; this.transform.eulerAngles = rightRotation; RightOrthoUpdate(); }
/****** SET VARIOUS CAMERA VIEWS ******/ public void SetToPerspective() { currentView = CameraViews.PERSPECTIVE; myCam.orthographic = false; this.transform.SetParent(ghostCamera.transform); PerspectiveUpdate(); }
public void SetToTopOrtho() { currentView = CameraViews.TOP; myCam.orthographic = true; this.transform.eulerAngles = topRotation; TopOrthoUpdate(); }
public void SetToBackOrtho() { currentView = CameraViews.BACK; myCam.orthographic = true; this.transform.eulerAngles = backRotation; BackOrthoUpdate(); }
private void GetCameraViews() { try { var collector = new FilteredElementCollector(ModelDoc); var threeDViews = collector.OfClass(typeof(View3D)).ToElements().Cast <View3D>().ToList(); foreach (var view in threeDViews) { if (view.ViewType != ViewType.ThreeD) { continue; } if (view.IsTemplate) { continue; } if (view.IsPerspective) { var viewInfo = new CameraViewInfo(view); if (worksetIds.Count > 0) { viewInfo.GetWorksetVisibilities(view, worksetIds); } if (!CameraViews.ContainsKey(viewInfo.ViewId)) { CameraViews.Add(viewInfo.ViewId, viewInfo); } } } } catch (Exception ex) { MessageBox.Show("Failed to get camera views.\n" + ex.Message, "Get Camera Views", MessageBoxButton.OK, MessageBoxImage.Warning); } }
/// <summary> /// Initializes a new instance of the <see cref="Form_3Dcuboid"/> class. /// </summary> /// <param name="imageFilePaths"> /// File paths of images used for 6 faces of cuboid. Index order is: Right (+X), Left (-X), Back (+Y), Front (-Y), Top (+Z), and Bottom (-Z). /// </param> /// <param name="dimensions"> /// Dimensions of the cuboid. /// </param> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> /// <param name="cameraDistance"> /// Distance of the camera from the world origin. /// </param> public Form_3Dcuboid(string[] imageFilePaths, float[] dimensions, CameraViews cameraView, float cameraDistance) { InitializeComponent(); MinimizeInsteadOfClose = false; transformationMatrix = new float[] { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f }; imageFiles = imageFilePaths; halfXdimension = dimensions[0] / 2; halfYdimension = dimensions[1] / 2; halfZdimension = dimensions[2] / 2; CameraView = cameraView; CameraDistance = cameraDistance; if (!sp.IsOpen) { sp.Open(); sp.ReadTimeout = 100; } formUpdateTimer = new Timer(); formUpdateTimer.Interval = 50; formUpdateTimer.Tick += new EventHandler(formUpdateTimer_Tick); }
public override void Awake() { base.Awake(); camera = Camera.main; CameraViews = new CameraViews(); CameraViews.Initialize(camera); effects = GetComponent <Effects>(); var playerPos = PlayerController.Instance.transform.position; transform.position = new Vector3(playerPos.x, playerPos.y, transform.position.z); playerMinimapView = PlayerController.Instance.gameObject.transform.GetComponentInChildren <MinimapElement>(); }
/// <summary> /// Initializes a new instance of the <see cref="CameraView"/> class. /// </summary> public CameraView(ICamera camera, CameraViews view) { if (camera == null) throw new ArgumentNullException("camera"); if (view == CameraViews.Unknown) throw new ArgumentOutOfRangeException("view"); this.Stretch = Stretch.Uniform; View = view; Camera = camera; camera.FrameAvailable += Camera_FrameAvailable; }
/// <summary> /// Initializes a new instance of the <see cref="CameraView"/> class. /// </summary> public CameraView(ICamera camera, CameraViews view) { if (camera == null) { throw new ArgumentNullException("camera"); } if (view == CameraViews.Unknown) { throw new ArgumentOutOfRangeException("view"); } this.Stretch = Stretch.Uniform; View = view; Camera = camera; camera.FrameAvailable += Camera_FrameAvailable; }
/// <summary> /// Initializes a new instance of the <see cref="Form_3Dcuboid"/> class. /// </summary> /// <param name="imageFilePaths"> /// File paths of images used for 6 faces of cuboid. Index order is: Right (+X), Left (-X), Back (+Y), Front (-Y), Top (+Z), and Bottom (-Z). /// </param> /// <param name="dimensions"> /// Dimensions of the cuboid. /// </param> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> /// <param name="cameraDistance"> /// Distance of the camera from the world origin. /// </param> public Form_3Dcuboid(string[] imageFilePaths, float[] dimensions, CameraViews cameraView, float cameraDistance) { InitializeComponent(); MinimizeInsteadOfClose = false; transformationMatrix = new float[] {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; imageFiles = imageFilePaths; halfXdimension = dimensions[0] / 2; halfYdimension = dimensions[1] / 2; halfZdimension = dimensions[2] / 2; CameraView = cameraView; CameraDistance = cameraDistance; formUpdateTimer = new Timer(); formUpdateTimer.Interval = 20; formUpdateTimer.Tick += new EventHandler(formUpdateTimer_Tick); }
/// <summary> /// Initializes a new instance of the <see cref="Form_3Dcuboid"/> class. /// </summary> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> /// <param name="cameraDistance"> /// Distance of the camera from the world origin. /// </param> public Form_3Dcuboid(CameraViews cameraView, float cameraDistance) : this(new string[] { "Form_3Dcuboid/Right.png", "Form_3Dcuboid/Left.png", "Form_3Dcuboid/Back.png", "Form_3Dcuboid/Front.png", "Form_3Dcuboid/Top.png", "Form_3Dcuboid/Bottom.png" }, new float[] { 6, 4, 2 }, cameraView, cameraDistance) { }
/// <summary> /// Initializes a new instance of the <see cref="Form_3Dcuboid"/> class. /// </summary> /// <param name="dimensions"> /// Dimensions of the cuboid. /// </param> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> /// <param name="cameraDistance"> /// Distance of the camera from the world origin. /// </param> public Form_3Dcuboid(float[] dimensions, CameraViews cameraView, float cameraDistance) : this(new string[] { "Form_3Dcuboid/Right.png", "Form_3Dcuboid/Left.png", "Form_3Dcuboid/Back.png", "Form_3Dcuboid/Front.png", "Form_3Dcuboid/Top.png", "Form_3Dcuboid/Bottom.png" }, dimensions, cameraView, cameraDistance) { }
/// <summary> /// Initializes a new instance of the <see cref="Form_3Dcuboid"/> class. /// </summary> /// <param name="imageFilePaths"> /// File paths of images used for 6 faces of cuboid. Index order is: Right (+X), Left (-X), Back (+Y), Front (-Y), Top (+Z), and Bottom (-Z). /// </param> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> /// <param name="cameraDistance"> /// Distance of the camera from the world origin. /// </param> public Form_3Dcuboid(string[] imageFilePaths, CameraViews cameraView, float cameraDistance) : this(imageFilePaths, new float[] { 6, 4, 2 }, cameraView, cameraDistance) { }
void Start() { this.transform.SetParent(ghostCamera.transform); myCam = this.GetComponent <Camera> (); currentView = CameraViews.PERSPECTIVE; }
/// <summary> /// Initializes a new instance of the <see cref="Form_3Dcuboid"/> class. /// </summary> /// <param name="imageFilePaths"> /// File paths of images used for 6 faces of cuboid. Index order is: Right (+X), Left (-X), Back (+Y), Front (-Y), Top (+Z), and Bottom (-Z). /// </param> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> public Form_3Dcuboid(string[] imageFilePaths, CameraViews cameraView) : this(imageFilePaths, new float[] { 6, 4, 2 }, cameraView, 50.0f) { }
/// <summary> /// Initializes a new instance of the <see cref="CameraFrame"/> class. /// </summary> /// <param name="sourceFrame">The source frame.</param> /// <param name="view">The view.</param> public CameraFrame(dynamic sourceFrame, CameraViews view) { SourceFrame = sourceFrame; View = view; }
/// <summary> /// Initializes a new instance of the <see cref="Form_3D"/> class. /// </summary> /// <param name="dimensions"> /// Dimensions of the cuboid. /// </param> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> public Form_3D(float[] dimensions, CameraViews cameraView) : this(new string[] { "Form_3D/Right.png", "Form_3D/Left.png", "Form_3D/Back.png", "Form_3D/Front.png", "Form_3D/Top.png", "Form_3D/Bottom.png" }, dimensions, cameraView, 50.0f) { }
/// <summary> /// Initializes a new instance of the <see cref="Form_3Dcuboid"/> class. /// </summary> /// <param name="dimensions"> /// Dimensions of the cuboid. /// </param> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> public Form_3Dcuboid(float[] dimensions, CameraViews cameraView) : this(new string[] { "Right.png", "Left.png", "Back.png", "Front.png", "Top.png", "Bottom.png" }, dimensions, cameraView, 50.0f) { }
/// <summary> /// Initializes a new instance of the <see cref="Form_3Dcuboid"/> class. /// </summary> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> public Form_3Dcuboid(CameraViews cameraView) : this(new string[] { "Right.png", "Left.png", "Back.png", "Front.png", "Top.png", "Bottom.png" }, new float[] { 6, 4, 2 }, cameraView, 50.0f) { }
/// <summary> /// Initializes a new instance of the <see cref="Form_3D"/> class. /// </summary> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> public Form_3D(CameraViews cameraView) : this(new string[] { "Form_3D/Right.png", "Form_3D/Left.png", "Form_3D/Back.png", "Form_3D/Front.png", "Form_3D/Top.png", "Form_3D/Bottom.png" }, new float[] { 6, 4, 2 }, cameraView, 50.0f) { }
/// <summary> /// Initializes a new instance of the <see cref="Form_3Dcuboid"/> class. /// </summary> /// <param name="imageFilePaths"> /// File paths of images used for 6 faces of cuboid. Index order is: Right (+X), Left (-X), Back (+Y), Front (-Y), Top (+Z), and Bottom (-Z). /// </param> /// <param name="dimensions"> /// Dimensions of the cuboid. /// </param> /// <param name="cameraView"> /// Value describing the camera view of the cuboid. /// </param> public Form_3Dcuboid(string[] imageFilePaths, float[] dimensions, CameraViews cameraView) : this(imageFilePaths, dimensions, cameraView, 50.0f) { }