coordinates

How to find view point coordinates?

梦想的初衷 提交于 2019-12-11 07:42:54
问题 I have azimuth , elevation and direction vector of the sun.. i want to place a view point on sun ray direction with some distance. Can anyone describe or provide a link to a resource that will help me understand and implement the required steps? I used cartesian coordinate system to find direction vector from azimuth and elevation.and then for find viewport origin.image for this question x = distance y = distance* tan azimuth z = distance * tan elevation. i want to find that distance value...

convert 2D screen coordinates to 3D space coordinates in C++?

白昼怎懂夜的黑 提交于 2019-12-11 06:39:35
问题 I'm writing a 2D game using a wrapper of OpenGLES . There is a camera aiming at a bunch of textures, which are the sprites for the game. The user should be able to move the view around by moving their fingers around on the screen. The problem is, the camera is about 100 units away from the textures, so when the finger is slid across the screen to pan the camera, the sprites move faster than the finger due to parallax effect. So basically, I need to convert 2D screen coordinates, to 3D

Text rotation in PDF

谁说我不能喝 提交于 2019-12-11 06:34:09
问题 So I have this situation: using pdftoxml.exe from sourceforge.net I got text tokens and their coordinates. If the pdf file was rotated (i.e. it has a /Rotate 90 written in its source) pdftoxml.exe swaps height and width of a given page and also x and y coordinates of any given object. That is what I understand. I was happy with it, until I came across a pdf file which used re to draw thick lines. That is, for a thick line, 4 thin lines are drawn and the space is filled, like in this picture.

How can get x and y position of an image in android on onCreate?

て烟熏妆下的殇ゞ 提交于 2019-12-11 04:44:45
问题 I want current X & Y co ordinates of an ImageView on onCreate of Activity , is there any solution for the same ? Please share your idea on same. 回答1: Actually, when you call setContentView() the Android nutshell starts the views drawing on surface, Which you can observe on using viewTrewwObserve So you can not get the height and width of ImageView in onCreate() as its not currently draw yet. You can use, (Not tried) imageView.getViewTreeObserver().addOnGlobalLayoutListener( new

Moved coordinates of the scene when DOM element with renderer is not at the top of the screen

时光毁灭记忆、已成空白 提交于 2019-12-11 04:08:14
问题 I encountered a problem, where I have a three.js scene in angular custom directive, which is in the view. A the top, I have a navigation bar which is always there to provide navigatin and switching between wiews (nothing abnormal yet). Lets say I set up a simple scene (as many times before, but not under the angular), I put a simple cube in the scene, set up camera rotation and other basic stuff. Problem starts when I try to hit that object on mouse down (raycaster works perfectly) but it

Getting Elevation for many coordinates

天涯浪子 提交于 2019-12-11 03:49:14
问题 I have a text file with many lats and longs, and I am trying to get their elevation. I found a website that already does that but it takes 500 only at a time, I have 1 million points. Is there any kind of service that does such thing? 回答1: The google maps API elevation service is limited to prevent abuse. There is publicly available elevation data: http://www2.jpl.nasa.gov/srtm/ Create your own service. 回答2: You can also use geonames.org. You can purchase a commercial account to have higher

“Drawing” an arc in discrete x-y steps

六眼飞鱼酱① 提交于 2019-12-11 03:31:05
问题 What's the best way to draw an arc using only x-y position movements? For example let's say I want to draw a circle with radius 4 at point (4,4). Let's saw my "drawer" starts at (4,0) and a resolution of .1 steps in each direction. How would I create a sequence of movements to complete the circle? If that's not clear I can try to explain better. 回答1: If I understand your question properly, you are looking for Bresenham's algorithm. You can read about it here, for example. 回答2: You want the

Find all point pairs closer than a given maximum distance

家住魔仙堡 提交于 2019-12-11 03:18:00
问题 I want to find (efficiently) all pairs of points that are closer than some distance max_d . My current method, using cdist , is: import numpy as np from scipy.spatial.distance import cdist def close_pairs(X,max_d): d = cdist(X,X) I,J = (d<max_d).nonzero() IJ = np.sort(np.vstack((I,J)), axis=0) # remove diagonal element IJ = IJ[:,np.diff(IJ,axis=0).ravel()<>0] # remove duplicate dt = np.dtype([('i',int),('j',int)]) pairs = np.unique(IJ.T.view(dtype=dt)).view(int).reshape(-1,2) return pairs def

How to Obtain Lat/Lng of Google Maps Query String?

大憨熊 提交于 2019-12-11 03:15:06
问题 I have this link: http://www.google.com/maps?cid=0,0,612446611849848549&f=q&source=embed&hl=en&geocode=&q=Универзална+Сала+&sll=,&&ie=UTF8&hq=&hnear=Универзална+Сала+&ll=,&z=15&iwloc=near What I want is to retrieve the Lat Lng of the pinpointed place. I have already tried to use the geocoding API: http://maps.googleapis.com/maps/api/geocode/xml?q=Универзална+Сала+&sensor=false but I am getting no results because the pinpoint refers to a place and not an address. How do I obtain the Lat Lng of

How to find third coordinate of triangle when two coordinates and their corresponding angles are given

人盡茶涼 提交于 2019-12-11 02:55:26
问题 i am trying to calculate third coordinate of triangle ABC, where A(x1,y1) B(x2,y2) angle CAB=a1 and angle CBA=a2. i need to find third coordinate C(x3,y3) i had thought of using law of cosines, but they may result some complex equations to solve. i need some simple technique to solve them, or using some direct formulas or any other method that can be implemented in computer program. can anyone help me in this problem? 回答1: At least two ways are possible: Through lines Build a line equation