coordinate-transformation

Reference coordinate system changes between OpenCV, OpenGL and Android Sensor

邮差的信 提交于 2019-11-27 04:22:33
问题 I am working with OpenCV , Android and OpenGL for an Augmented Reality project. As far as I know the coordintate system in OpenGL is The OpenCV coordinate system is: When combining these devices with android sensors how can I do the coordinate system conversions and [R|t] matrix conversion? Is there a good tutorial or documentation were all of this conffusing stuff is explained? 回答1: If you look at the picture, then you see, that the both coordinate systems have the same handednes, but the

Converting longitude/latitude to X/Y coordinate

老子叫甜甜 提交于 2019-11-26 23:46:08
I created a map using Google Maps API that highlights all Minnesota counties. Basically, I created the county polygons using a set of longitudes/latitudes coordinates. Here's a screenshot of the generated map:- One of the user requirements is to be able to have a similar map as an image so that they can embed it in their PowerPoint/keynote slides. I couldn't find any useful Google Maps API that allows me to save my custom map the way it is (if you know a way, let me know), so I figure I should just draw it with Graphics2D in Java. After reading about the formulas to convert the longitude

How to set transform origin in SVG

删除回忆录丶 提交于 2019-11-26 18:18:29
I need to resize and rotate certain elements in SVG document using javascript. The problem is, by default, it always applies the transform around the origin at (0, 0) – top left. How can I re-define this transform anchor point? I tried using the transform-origin attribute, but it does not affect anything. This is how I did it: svg.getDocumentById('someId').setAttribute('transform-origin', '75 240'); It does not seem to set the pivotal point to the point I specified although I can see in Firefox that the attribute is correctly set. I tried things like center bottom and 50% 100% with and without

OpenGL translation before and after a rotation

余生颓废 提交于 2019-11-26 12:33:49
问题 The following is code (taken from http://www.glprogramming.com/red/chapter03.html) regarding how to draw a robot\'s arm and shoulder and rotating them by some user input: glPushMatrix(); glTranslatef (-1.0, 0.0, 0.0); glRotatef ((GLfloat) shoulder, 0.0, 0.0, 1.0); glTranslatef (1.0, 0.0, 0.0); glPushMatrix(); glScalef (2.0, 0.4, 1.0); glutWireCube (1.0); glPopMatrix(); glTranslatef (1.0, 0.0, 0.0); glRotatef ((GLfloat) elbow, 0.0, 0.0, 1.0); glTranslatef (1.0, 0.0, 0.0); glPushMatrix();

Acceleration from device's coordinate system into absolute coordinate system

ぐ巨炮叔叔 提交于 2019-11-26 11:54:51
问题 From my Android device I can read an array of linear acceleration values (in the device\'s coordinate system) and an array of absolute orientation values (in Earth\'s coordinate system). What I need is to obtain the linear acceleration values in the latter coord. system. How can I convert them? EDIT after Ali\'s reply in comment: All right, so if I understand correctly, when I measure the linear acceleration, the position of the phone completely does not matter, because the readings are given

Determining UTM zone (to convert) from longitude/latitude

ⅰ亾dé卋堺 提交于 2019-11-26 11:13:48
问题 I\'m writing a program which expects a number of lat/long points, and I convert them internally to UTM in order to do some calculations in metres. The range of the lat/long points themselves is quite small -- about 200m x 200m. They can be relied on almost always to be within a single UTM zone (unless you get unlucky and are across the border of a zone). However, the zone that the lat/longs are in is unrestricted. One day the program might be run for people in Australia (and oh, how many

Converting longitude/latitude to X/Y coordinate

白昼怎懂夜的黑 提交于 2019-11-26 08:47:14
问题 I created a map using Google Maps API that highlights all Minnesota counties. Basically, I created the county polygons using a set of longitudes/latitudes coordinates. Here\'s a screenshot of the generated map:- One of the user requirements is to be able to have a similar map as an image so that they can embed it in their PowerPoint/keynote slides. I couldn\'t find any useful Google Maps API that allows me to save my custom map the way it is (if you know a way, let me know), so I figure I

How to recover view space position given view space depth value and ndc xy

六眼飞鱼酱① 提交于 2019-11-26 05:36:55
问题 I am writing a deferred shader, and am trying to pack my gbuffer more tightly. However, I cant seem to compute the view position given the view space depth correctly // depth -> (gl_ModelViewMatrix * vec4(pos.xyz, 1)).z; where pos is the model space position // fov -> field of view in radians (0.62831855, 0.47123888) // p -> ndc position, x, y [-1, 1] vec3 getPosition(float depth, vec2 fov, vec2 p) { vec3 pos; pos.x = -depth * tan( HALF_PI - fov.x/2.0 ) * (p.x); pos.y = -depth * tan( HALF_PI

Transform the modelMatrix

谁都会走 提交于 2019-11-26 02:25:33
问题 It is easy to set the ViewMatrix with glm: glm::lookAt(Position, Direction, UpVector); but if I try to use the funktion with the modelMatrix, I\'ll get comfusing values (the Model is not in the correct position and also the rotation looks wrong). I just want to set an object the same way than setting the camera. Can I use the lookAt funktion and make some changes afterwards? Or does I have to program an own funtion for that? And if so, how? I fixed the position with this: m_Orientation = glm: