{"action":"created","issue":{"url":"https://api.github.com/repos/xBimTeam/XbimWindowsUI/issues/7","labels_url":"https://api.github.com/repos/xBimTeam/XbimWindowsUI/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/xBimTeam/XbimWindowsUI/issues/7/comments","events_url":"https://api.github.com/repos/xBimTeam/XbimWindowsUI/issues/7/events","html_url":"https://github.com/xBimTeam/XbimWindowsUI/issues/7","id":93587408,"number":7,"title":"Initialized CameraPosition","user":{"login":"LitsaM","id":13109297,"avatar_url":"https://avatars.githubusercontent.com/u/13109297?v=3","gravatar_id":"","url":"https://api.github.com/users/LitsaM","html_url":"https://github.com/LitsaM","followers_url":"https://api.github.com/users/LitsaM/followers","following_url":"https://api.github.com/users/LitsaM/following{/other_user}","gists_url":"https://api.github.com/users/LitsaM/gists{/gist_id}","starred_url":"https://api.github.com/users/LitsaM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LitsaM/subscriptions","organizations_url":"https://api.github.com/users/LitsaM/orgs","repos_url":"https://api.github.com/users/LitsaM/repos","events_url":"https://api.github.com/users/LitsaM/events{/privacy}","received_events_url":"https://api.github.com/users/LitsaM/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"CBenghi","id":5476273,"avatar_url":"https://avatars.githubusercontent.com/u/5476273?v=3","gravatar_id":"","url":"https://api.github.com/users/CBenghi","html_url":"https://github.com/CBenghi","followers_url":"https://api.github.com/users/CBenghi/followers","following_url":"https://api.github.com/users/CBenghi/following{/other_user}","gists_url":"https://api.github.com/users/CBenghi/gists{/gist_id}","starred_url":"https://api.github.com/users/CBenghi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CBenghi/subscriptions","organizations_url":"https://api.github.com/users/CBenghi/orgs","repos_url":"https://api.github.com/users/CBenghi/repos","events_url":"https://api.github.com/users/CBenghi/events{/privacy}","received_events_url":"https://api.github.com/users/CBenghi/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-07-07T17:43:35Z","updated_at":"2015-09-09T18:10:34Z","closed_at":"2015-09-09T18:10:34Z","body":"Hi again,\r\n\r\nI am trying to set a default camera position for the model but I can't find how.\r\nI first added this code:\r\n\r\n        // The camera.\r\n        private PerspectiveCamera TheCamera;\r\n\r\n        // The camera's current location.\r\n        private double CameraPhi = Math.PI / 6.0;       // 30 degrees\r\n        private double CameraTheta = Math.PI / 6.0;     // 30 degrees\r\n        private double CameraR = 3.0;\r\n\r\n    TheCamera = new PerspectiveCamera();\r\n            TheCamera.FieldOfView = 100;\r\n            DrawingControl.SetCamera(TheCamera);\r\n            PositionCamera();\r\n\r\n    private void PositionCamera()\r\n        {\r\n            // Calculate the camera's position in Cartesian coordinates.\r\n            double y = CameraR * Math.Sin(CameraPhi);\r\n            double hyp = CameraR * Math.Cos(CameraPhi);\r\n            double x = hyp * Math.Cos(CameraTheta);\r\n            double z = hyp * Math.Sin(CameraTheta);\r\n            TheCamera.Position = new Point3D(x, y, z);\r\n\r\n            // Look toward the origin.\r\n            TheCamera.LookDirection = new Vector3D(-x, -y, -z);\r\n\r\n            // Set the Up direction.\r\n            TheCamera.UpDirection = new Vector3D(0, 1, 0);\r\n        }\r\n\r\nAnd didn't work so then I added this (after I deleted everything from above):\r\n\r\n            // Defines the camera used to view the 3D object. In order to view the 3D object, \r\n            // the camera must be positioned and pointed such that the object is within view  \r\n            // of the camera.\r\n            PerspectiveCamera myPCamera = new PerspectiveCamera();\r\n\r\n            // Specify where in the 3D scene the camera is.\r\n            myPCamera.Position = new Point3D(0, 0, 2);\r\n\r\n            // Specify the direction that the camera is pointing.\r\n            myPCamera.LookDirection = new Vector3D(0, 0, -1);\r\n\r\n            // Define camera's horizontal field of view in degrees.\r\n            myPCamera.FieldOfView = 60;\r\n\r\n            // Asign the camera to the viewport\r\n            myViewport3D.Camera = myPCamera;\r\n\r\n    <Viewport3D x:Name=\"myViewport3D\">\r\n            <!-- Add a camera. -->\r\n            <Viewport3D.Camera>\r\n                <PerspectiveCamera FarPlaneDistance=\"20\" LookDirection=\"5,-2,-3\" UpDirection=\"0,1,0\"  NearPlaneDistance=\"1\" Position=\"-5,2,3\" FieldOfView=\"45\" />\r\n            </Viewport3D.Camera>\r\n        </Viewport3D>\r\n...\r\n\r\nBut then I figured out that they changed the camera podition but when my program opens the model, then the camera position changes. I don't know how to explain that so you can understand but I guess that after opening the model there is somewhere in the project that they give an initial or default matrix for the view of the model or the camera positions of viewing the model. But I can't find where is that so I can change it."},"comment":{"url":"https://api.github.com/repos/xBimTeam/XbimWindowsUI/issues/comments/138994909","html_url":"https://github.com/xBimTeam/XbimWindowsUI/issues/7#issuecomment-138994909","issue_url":"https://api.github.com/repos/xBimTeam/XbimWindowsUI/issues/7","id":138994909,"user":{"login":"CBenghi","id":5476273,"avatar_url":"https://avatars.githubusercontent.com/u/5476273?v=3","gravatar_id":"","url":"https://api.github.com/users/CBenghi","html_url":"https://github.com/CBenghi","followers_url":"https://api.github.com/users/CBenghi/followers","following_url":"https://api.github.com/users/CBenghi/following{/other_user}","gists_url":"https://api.github.com/users/CBenghi/gists{/gist_id}","starred_url":"https://api.github.com/users/CBenghi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CBenghi/subscriptions","organizations_url":"https://api.github.com/users/CBenghi/orgs","repos_url":"https://api.github.com/users/CBenghi/repos","events_url":"https://api.github.com/users/CBenghi/events{/privacy}","received_events_url":"https://api.github.com/users/CBenghi/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T18:10:34Z","updated_at":"2015-09-09T18:10:34Z","body":"I'm closing the issue, feel free to write again if it needs refining."}}