coordinate-transformation

Trouble translating Touch coordinates following device orientation change

牧云@^-^@ 提交于 2019-12-08 07:26:06
问题 Ok the scenario is that I have a custom class which creates a view containing an image and handles all its own touch events. Occasionally I want to check if moving it would cause it to overlap another view on a parent view. So after the relevent touch event I call a method on the parent view passing it the last touch cordinate and return a BOOL. This works fine while the application remains in portrait orientation. Problem is after rotating the device and all the images are auto-rotated for

Rotating a multipart object

天涯浪子 提交于 2019-12-08 07:14:55
问题 I've created an object that has about 7+ parts to it including its body and smaller parts that 'attach' to it in different places. My goal is to rotate the entire object. I tried to simply call glRotatef(angle, 0, 1, 0) before constructing the entire object, but I realize that this seems to rotate 'everything' around the origin, no matter the translation. The following code was an attempt to rotate the body itself and rotate the attached parts to it. // glRotatef(angle, 0, 1, 0); //old way of

three.js Vector3 to 2D screen coordinate with rotated scene

自作多情 提交于 2019-12-08 02:18:13
问题 I am trying to position a div such that it is always at the highest point of an object offset left and up a little so it is not right on top of the vertex. You can see that here. Please see the working with no scene rotation snippet below if the jsfiddle link no longer works. I can tell you, it works fairly marvellously. However, for a project at work, I need to rotate the scene, itself. Apparently, this messes up the conversion to 2D screen coordinates. You can view this here. You can view

Offset LatLng by some amount of meters in Android

时间秒杀一切 提交于 2019-12-07 06:17:21
问题 I have a LatLng object and I want to shift it's coordinates 500 meters to the east. I couldn't find a built-in method for that. I've seen https://gis.stackexchange.com/a/2964 but my results are just too inaccurate (about 15%) to use practically. How can I make a precise shift in meters? Note: I am NOT looking for shifting a Google Maps camera, I know how to do that. I've tried: static final double KILOMETERS_PER_DEGREE = 111.111; static LatLng offsetLongitude(LatLng initialCoords, float

Not able to translate device co-ordinate system to world co-ordinate system on android

一世执手 提交于 2019-12-06 13:15:42
I have written a small code to convert the device co-ordinates into world co-ordinates by multiplying the Rotation matrix(using getRotationMatrix) and the vector (Ax,Ay,Az) which are the accelerometer values. When I run this, and the phone is static, I get a very fluctuating value for the Z axis(from 9.3 to 10.3) and the other two are 0. However when I give the phone some acceleration in any direction , it still doesn't show any change to those values and they remain zero. This is the part of the code where I get the values. if(ctp.getType()==Sensor.TYPE_ACCELEROMETER){ Ca[0]=event.values[0];

How to convert Earth Centered Inertial (ECI) coordinates to Earth Centered Earth Fixed (ECEF) AstroPy? Other?

China☆狼群 提交于 2019-12-06 12:04:13
问题 I have position (x,y,z) and velocity (Vx,Vy,Vz) vectors in Earth Centered Inertial Coordinates (ECI) for a satellite orbit, and ultimately want to end up with geodetic coordinates (Latitude, Longitude, & Altitude). According to this other Stack Overflow question it seems that I need to convert to Earth Centered Earth Fixed (ECEF) coordinates as an intermediate step (so ECI --> ECEF --> Lat/Lon/Alt). I know ECI and ECEF share the same origin point (the center of mass of Earth) and the same z

Madgwick's sensor fusion algorithm on iOS

喜欢而已 提交于 2019-12-06 09:33:00
i'm trying to run Madgwick's sensor fusion algorithm on iOS. Since the code is open source i already included it in my project and call the methods with the provided sensor values. But it seems, that the algorithm expects the sensor measurements in a different coordinate system. The Apple CoreMotion Sensor System is given on the right side, Madgewick's on the left. Here is the picture of the different coordinate systems . Both systems follow the right hand rule. For me it seems like there is a 90 degree rotation around the z axis. But this didn't work. I also tried to flip x and y (and invert

three.js Vector3 to 2D screen coordinate with rotated scene

怎甘沉沦 提交于 2019-12-06 09:29:50
I am trying to position a div such that it is always at the highest point of an object offset left and up a little so it is not right on top of the vertex. You can see that here . Please see the working with no scene rotation snippet below if the jsfiddle link no longer works. I can tell you, it works fairly marvellously. However, for a project at work, I need to rotate the scene, itself. Apparently, this messes up the conversion to 2D screen coordinates. You can view this here . You can view the not working with scene rotation snippet below as well. As you can see, the label does not update

Trying to rotate and transform SVG path - do I need trigonometry calculations?

随声附和 提交于 2019-12-06 07:46:39
问题 I'm trying to manipulate with mouse SVG path which represents symbol of electronics resistor. This symbol requires manipulation with end of the "leads" (if you can picture real resistor); therefore I am trying to achieve draging 1st point arround (2nd is still there) and to all points of path to behave proportionally in when drag the 1st point on new coordinates. Try to group, try with trigonometry functions...so code is like: `<g id="r" > <!-- R - group for symbol of electronics resistor -->

OSM: convert ties from projected coordinates in spherical mercator “EPSG:900913” to “EPSG:4326” coordinates

萝らか妹 提交于 2019-12-06 06:56:12
问题 I'm using a map with a layer (from the example): var lonLat = new OpenLayers.LonLat(40.4088576, -86.8576718) .transform( new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984 map.getProjectionObject() // to Spherical Mercator Projection ); on moveend i'm get center coordinates: map.getCenter(); map.getZoom(); and zoom level: 4925535.4503328, -9668990.0134335, 12 Using algorithm from documentation public PointF TileToWorldPos(double tile_x, double tile_y, int zoom) { PointF p =