{"action":"closed","issue":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/4073","repository_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/4073/labels{/name}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/4073/comments","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/4073/events","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/issues/4073","id":163251295,"number":4073,"title":"working with ray object:Uncaught TypeError: Cannot read property 'x' of undefinedo.multiplyComponents @ Cesium.js:423","user":{"login":"am2222","id":4707503,"avatar_url":"https://avatars.githubusercontent.com/u/4707503?v=3","gravatar_id":"","url":"https://api.github.com/users/am2222","html_url":"https://github.com/am2222","followers_url":"https://api.github.com/users/am2222/followers","following_url":"https://api.github.com/users/am2222/following{/other_user}","gists_url":"https://api.github.com/users/am2222/gists{/gist_id}","starred_url":"https://api.github.com/users/am2222/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/am2222/subscriptions","organizations_url":"https://api.github.com/users/am2222/orgs","repos_url":"https://api.github.com/users/am2222/repos","events_url":"https://api.github.com/users/am2222/events{/privacy}","received_events_url":"https://api.github.com/users/am2222/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-30T19:45:15Z","updated_at":"2016-06-30T20:06:23Z","closed_at":"2016-06-30T20:06:23Z","body":"Hi,\r\nI am going to create a circle and in each degree I create a ray and find the intersection of that ray with surrounding objects, \r\nwell, I come up with this code\r\n` \r\n    var viewer = new Cesium.Viewer('cesiumContainer');\r\n    var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);\r\n    handler.setInputAction(function(click) {\r\n\r\n            var cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);\r\n         \r\n\r\n        var x=Cesium.Math.toDegrees(cartographicPosition.latitude);\r\n        var y=Cesium.Math.toDegrees(cartographicPosition.longitude);\r\n       // alert(x);//35\r\n      //  alert(y);//-101\r\n        var radius=0.01;\r\n        var segmants=360;\r\n        var seg=Math.PI*2/segmants;\r\n        var origin=  new Cesium.Cartesian3(x, y, 0);\r\n        var shape = [];\r\n        for (i = 0; i <= segmants; i++) {\r\n            var teta=seg*i;\r\n            var a =x+Math.cos(teta)*radius;\r\n            var b =y+Math.sin(teta)*radius;\r\n            shape.push(a);\r\n            shape.push(b);\r\n            var origin=  new Cesium.Cartesian3(x, y, 0);\r\n            var direction=  new Cesium.Cartesian3(a, b, 0);\r\n            alert(direction.toString());\r\n            alert(origin.toString());\r\n            var ray=new Cesium.Ray(origin, direction);\r\n            alert(ray.toString());\r\n           var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, blueEllipse);\r\n            alert(intersection.toString());\r\n            if(intersection!=undefined){\r\n                  var point = Cesium.Ray.getPoint(ray, intersection.start);\r\n                  alert(point.toString());\r\n\r\n            }\r\n\r\n\r\n\r\n           // shape.push(point.x);\r\n           /// alert(point.x.toString());\r\n           // shape.push(point.y);\r\n\r\n        }\r\n        shape.push(shape[0]);\r\n        shape.push(shape[1]);\r\n        alert(shape);\r\n        var resultPolygon = viewer.entities.add({\r\n            name : 'result',\r\n            polygon : {\r\n                hierarchy : Cesium.Cartesian3.fromDegreesArray(shape),\r\n                material : Cesium.Color.YELLOW\r\n            }\r\n        });\r\n\r\n\r\n        viewer.zoomTo(resultPolygon.position);\r\n    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);\r\n    var blueEllipse = viewer.entities.add({\r\n        position: Cesium.Cartesian3.fromDegrees(-101.2660238862044, 35.334352672773285,0.01),\r\n        name : 'Blue translucent, rotated, and extruded ellipse with outline',\r\n        ellipse : {\r\n            semiMinorAxis : 150000.0,\r\n            semiMajorAxis : 300000.0,\r\n            extrudedHeight : 200000.0,\r\n            rotation : Cesium.Math.toRadians(45),\r\n            material : Cesium.Color.BLUE.withAlpha(0.5),\r\n            outline : true\r\n        }\r\n    });`\r\n\r\n\r\nwhen I click a loaction a ray must be created and the intersection must be find but this comes up with this error \r\n`Cesium.js:423 Uncaught TypeError: Cannot read property 'x' of undefinedo.multiplyComponents @ Cesium.js:423f.rayEllipsoid @ Cesium.js:425(anonymous function) @ HelloWorld.html:68v @ Cesium.js:435n @ Cesium.js:435`\r\n\r\nwhere is my mistake?can you please help me find the solution?\r\nthanks"}}
{"actor":{"display_login":"shunter"}}