projection

What exactly are eye space coordinates?

五迷三道 提交于 2019-11-27 00:04:15
问题 As I am learning OpenGL I often stumble upon so-called eye space coordinates. If I am right, you typically have three matrices. Model matrix, view matrix and projection matrix. Though I am not entirely sure how the mathematics behind that works, I do know that the convert coordinates to world space, view space and screen space. But where is the eye space, and which matrices do I need to convert something to eye space? 回答1: Perhaps the following illustration showing the relationship between

Projections in NHibernate

杀马特。学长 韩版系。学妹 提交于 2019-11-26 23:36:14
问题 suppose in an entity there are attributes id, username, age, address. Now I just want id and username and I use this code for it. Projections enable the returning of something other than a list of entities from a query. var proj = Projections.ProjectionList() .Add(Projections.Property("Id"), "Id") .Add(Projections.Property("Username"), "Username"); var list2 = DetachedCriteria.For<User>() .Add(Expression.Eq("Username", "lachlan")) .GetExecutableCriteria( sessionFactory.GetCurrentSession())

Mercator longitude and latitude calculations to x and y on a cropped map (of the UK)

断了今生、忘了曾经 提交于 2019-11-26 17:18:38
I have this image: http://imgur.com/99tSz.png . A map of the UK (not including Southern Ireland). I have successfully managed to get a latitude and longitude and plot it onto this map by taking the leftmost longitude and rightmost longitude of the UK and using them to work out where to put the point on the map. This is the code (for use in Processing.js but could be used as js or anything): // Size of the map int width = 538; int height = 811; // X and Y boundaries float westLong = -8.166667; float eastLong = 1.762833; float northLat = 58.666667; float southLat = 49.95; void drawPoint(float

true isometric projection with opengl

筅森魡賤 提交于 2019-11-26 16:10:42
问题 I am a newbie in OpenGL programming with C++ and not very good at mathematics. Is there a simple way to have isometric projection? I mean the true isometric projection, not the general orthogonal projection. (Isometric projection happens only when projections of unit X, Y and Z vectors are equally long and angles between them are exactly 120 degrees.) Code snippets are highly appreciated.. 回答1: Try using gluLookAt glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL

correcting fisheye distortion programmatically

扶醉桌前 提交于 2019-11-26 15:41:55
BOUNTY STATUS UPDATE: I discovered how to map a linear lens , from destination coordinates to source coordinates. How do you calculate the radial distance from the centre to go from fisheye to rectilinear? 1). I actually struggle to reverse it, and to map source coordinates to destination coordinates. What is the inverse, in code in the style of the converting functions I posted? 2). I also see that my undistortion is imperfect on some lenses - presumably those that are not strictly linear. What is the equivalent to-and-from source-and-destination coordinates for those lenses? Again, more code

Convert lat/lon to pixel coordinate?

大憨熊 提交于 2019-11-26 15:26:34
I'm trying to convert a lat/lon pair to a pixel coordinate. I have found this mercator projection but I don't understand the code. What is the factor,x_adj, y_adj variable? When I run the code without those constants my lat/lon pair is not on my map and the x and y pixel coordinate is not what I want. function get_xy(lat, lng) { var mapWidth=2058; var mapHeight=1746; var factor=.404; var x_adj=-391; var y_adj=37; var x = (mapWidth*(180+lng)/360)%mapWidth+(mapWidth/2); var latRad = lat*Math.PI/180; var mercN = Math.log(Math.tan((Math.PI/4)+(latRad/2))); var y = (mapHeight/2)-(mapWidth*mercN/(2

How to work with DTO in Spring Data REST projects?

一世执手 提交于 2019-11-26 11:04:01
问题 Spring Data REST automates exposing only domain object. But most often we have to deal with Data Transfer Objects. So how to do this in SDR way? 回答1: An approach of how to work with DTO in Spring Data REST projects The working example is here Entities Entities must implement the Identifiable interface. For example: @Entity public class Category implements Identifiable<Integer> { @Id @GeneratedValue private final Integer id; private final String name; @OneToMany private final Set<Product>

OCR and character similarity

妖精的绣舞 提交于 2019-11-26 08:47:56
I am currently working on some kind of OCR (Optical Character Recognition) system. I have already written a script to extract each character from the text and clean (most of the) irregularities out of it. I also know the font. The images I have now for example are: M ( http://i.imgur.com/oRfSOsJ.png (font) and http://i.imgur.com/UDEJZyV.png (scanned)) K ( http://i.imgur.com/PluXtDz.png (font) and http://i.imgur.com/TRuDXSx.png (scanned)) C ( http://i.imgur.com/wggsX6M.png (font) and http://i.imgur.com/GF9vClh.png (scanned)) For all of these images I already have a sort of binary matrix (1 for

Mouse / Canvas X, Y to Three.js World X, Y, Z

。_饼干妹妹 提交于 2019-11-26 06:35:19
I've searched around for an example that matches my use case but cannot find one. I'm trying to convert screen mouse co-ordinates into 3D world co-ordinates taking into account the camera. Solutions I've found all do ray intersection to achieve object picking. What I am trying to do is position the center of a Three.js object at the co-ordinates that the mouse is currently "over". My camera is at x:0, y:0, z:500 (although it will move during the simulation) and all my objects are at z = 0 with varying x and y values so I need to know the world X, Y based on assuming a z = 0 for the object that

Mercator longitude and latitude calculations to x and y on a cropped map (of the UK)

Deadly 提交于 2019-11-26 05:20:22
问题 I have this image: http://imgur.com/99tSz.png. A map of the UK (not including Southern Ireland). I have successfully managed to get a latitude and longitude and plot it onto this map by taking the leftmost longitude and rightmost longitude of the UK and using them to work out where to put the point on the map. This is the code (for use in Processing.js but could be used as js or anything): // Size of the map int width = 538; int height = 811; // X and Y boundaries float westLong = -8.166667;