projection

Converting perspective projection to orthogonal projection

我的梦境 提交于 2019-12-13 19:36:32
问题 I created this program where the user clicks the right click of the mouse and he gets a menu where he can choose to draw a cube or a sphere in a perspective projection I would like him to be able to change the perspective projection to orthogonal projection. I want the shapes to be placed in the same spot just with orthogonal projection. I want him to be able to do it by clicking "O" in the keyboard and go back to perspective by clicking "p". how do I mix the orthogonal projection in this

Moving objects parallel to projection plane in three.js

烈酒焚心 提交于 2019-12-13 15:07:39
问题 I want to move objects along a plane parallel to the projection plane with the mouse. This means during the movement the distance between any picked object and camera projection plane (not camera position) must remain constant. A similar question has been asked: Mouse / Canvas X, Y to Three.js World X, Y, Z , but unlike there I need a solution working for arbitrary camera angles and camera/object positions not only for the plane with z=0. It also has to work for orthographic projection. Now I

mat4 project/unproject not working

穿精又带淫゛_ 提交于 2019-12-13 07:12:56
问题 I am trying to implement GLM's project and unproject functions in Lua but the results are... questionable. As far as I can tell, my code (shown below) is nearly identical to GLM, yet as the video below shows, the text doesn't display as intended. When I bring the camera to 0,0,0, the text forms a diamond pattern, which is interesting. What should be displayed here is the words cube.001 through cube.009 should be drawn on top of their respective cubes, regardless of where the camera moves.

(NetLogo: re-) transformation of turtle xcor/ycor to real-world coords

跟風遠走 提交于 2019-12-13 06:50:05
问题 I have a well functioning NetLogo model of pedestrians in a generic, urban environment loaded from shapefiles - including projection/transformation (See selected code lines below). How do I export the xcor's and ycors of turtles to text files, projected/transformed into the original projection system? Thanks in advance code examples... gis:load-coordinate-system (word "../data/testLines_2.prj") set ODLines gis:load-dataset "../data/testLines_2.shp" setUpEnvelopeExtented ODLines 10 回答1: maybe

Simple Leaflet.js Marker Placement

試著忘記壹切 提交于 2019-12-13 03:40:04
问题 I'm using the open source Leaflet.js library to create a simple map. I'm trying to solve a specific problem though. Markers are tied to a specific lat/lng on a map, which makes sense, but I need to be able to make a marker have a fixed offset position from another marker, without it being tied to a lat/lng center. So for example, the map may look like this: But when you zoom out, it'll look like this: What I actually want is for the right marker to be a fixed offset away from the left marker,

Orthographic and Perspective Camera issue

穿精又带淫゛_ 提交于 2019-12-13 02:57:05
问题 This image is using perspective camera but sphere shape is distorted when it is moving away from the center. this image is using Orthographic camera but spheres and cuboid are not in 3D... can any one suggest possible solution for this to get 3D effect without sphere distorting its shape... 回答1: This is exactly correct. Spheres distortion and cuboid perspective effect are both caused by the same perspective projection properties. One possible solution would be to split your scene in two parts

DJ3S - Graticule removed when rotation is done in orthographic projection

混江龙づ霸主 提交于 2019-12-12 18:03:54
问题 I am using D3JS orthographic projection to see the world as a sphere and I have added graticule under all the coutries. Everything is fine but when I add drag mecanism to allow rotation the graticule are removed during event handling. Here is the core code : var width = 1000, height = 1000; var projection = d3.geo.orthographic() .scale(475) .translate([width / 2, height / 2]) .clipAngle(90) .precision(.1) .rotate([0,0,0]); var path = d3.geo.path() .projection(projection); var graticule = d3

Projection of a image from inside a cylinder to a plane 2D [Matlab]

无人久伴 提交于 2019-12-12 09:07:43
问题 With a camera inside a cylinder I capture a image. I want to transform that image into a plane 2d. The image inside the cylinder have a lot of dots which forms a grid. What I tried to do was estimating the transformation. With blob analysis I can detect the center of each point and obtain the coordinates in pixels. I save this in matrix called ImCilynder. After that i create a matrix with coordinates of that points in the plane with the name Im2d. I calculate the transformation (H) solving

Changing the Projection of Shapefile

前提是你 提交于 2019-12-12 08:34:02
问题 I am trying to change or assign the projection of a Germany-Shapefile from NA to +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 , but somehow it doesn't work well. Reproducible Example: Shapefile and other files can be downloaded here: What I tried is the following: library(maptools) library(sp) library(rgeos) library(rgdal) projection.x <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0") mapG <- readShapePoly("vg2500_lan.shp", verbose=TRUE, proj4string

C#: Altering values for every item in an array

对着背影说爱祢 提交于 2019-12-12 07:14:04
问题 I'm wondering if there is built-in .NET functionality to change each value in an array based on the result of a provided delegate. For example, if I had an array {1,2,3} and a delegate that returns the square of each value, I would like to be able to run a method that takes the array and delegate, and returns {1,4,9} . Does anything like this exist already? 回答1: Not that I'm aware of (replacing each element rather than converting to a new array or sequence), but it's incredibly easy to write: