perspective

meaning of m34 of CATransform3D

ε祈祈猫儿з 提交于 2019-11-29 21:05:11
What's the meaning of m34 of the structure CATransform3D, I only know it can change the perspective, but what's the meaning when the value is -0.001 and 0.001? You can find the full details here . Note that Apple uses the reversed multiplication order for projection (relative to the given link) so all matrix multiplications are reversed and all matrices are transposed. A short description of the meaning: m34 = 1/z distance to projection plane (the 1/e z term in the reference link) + for the z axis is towards the viewer, resulting in a "looking in the mirror" feel when using - projection center

gluPerspective parameters- what do they mean?

僤鯓⒐⒋嵵緔 提交于 2019-11-29 19:36:53
I wonder about the gluPerspective parameters. In all examples I see fovy is set to around 45-60degrees I've tried to set it to different values and the object just disappears what's the explanation for it? The aspect value should always be the ratio? why would one change it? zNear, zFar - once again the usual values are around 10 and 500+ what does it reflect? gemse The purpose of the 4 parameters is to define a view frustum , like this: where nothing outside of the frustum should be is visible on screen ( To accomplish this, the parameters are used to calculate a 4x4 matrix, which is then

Distorting an image to a quadrangle fails in some cases on Android

半腔热情 提交于 2019-11-29 18:55:34
问题 I'm using matrix.setPolyToPoly function to transform a selected region (4 corners) of a bitmap into a rectangle and normally it works amazing. But in the next example: The polyToPoly function fails the perspective transform: I have drawn two lines for testing, the lines mark where I want the four selected points. What I'm doing wrong? Thanks! EDIT : I've solved the problem using canvas.drawBitmapMesh, Thanks pskink for your advice!! This is the final code private float[] generateVertices(int

OpenGL sutherland-hodgman polygon clipping algorithm in homogeneous coordinates (4D, CCS)

倾然丶 夕夏残阳落幕 提交于 2019-11-29 16:20:40
I have two questions. (I marked 1, 2 below) In OpenGl, the clipping is done by sutherland-hodgman. However, I wonder how to work sutherland-hodgman algorithm in homogeneous system (4D) I made a situation. In VCS, there is a line, R= (0, 3, -2, 1), S = (0, 0, 1, 1) (End points of the line) And a frustum is right = 1, left = -1, near = 1, far = 3, top = 4, bottom = -4 Therefore, the projection matrix P is 1 0 0 0 0 1/4 0 0 0 0 -2 -3 0 0 -1 0 If we calculate the line with the P, then the each end points is like that R' = (0, 3/4, 1, 2), S' = (0, 0, -5, -1) I know that perspective division should

How do I compete the transformation matrix needed to transform a rectangle into a trapezium?

强颜欢笑 提交于 2019-11-29 12:08:00
I'm playing around with css transforms and the equivalent filters in IE, and want to simulate perspective by transforming a 2d rectangle into a trapezium. Specifically, I want the right hand side of the rectangle to stay the same height, and the left hand side to be say 80% of the height, so that the mid points of both sides are horizontally in line with each other. I'm familiar with matrix algebra, but can't think how to determine what matrix will do that. For projection, I'd use a 4x4 matrix: 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1/d 1 This works on homogeneous coordinates (d is the distance of the

Can't get OpenCV's warpPerspective to work on Android

一个人想着一个人 提交于 2019-11-29 07:28:09
I've been struggling to implement a quad to quad system in my Android application. The aim is to let the user take a picture, add 4 cornerpoints and have that quad extracted from the image as a rectangle. I had a look at this method and this question to use OpenCV for this. The resulting code is this: public static Bitmap warp(Bitmap image, MyPoint p1, MyPoint p2, MyPoint p3, MyPoint p4) { int resultWidth = 500; int resultHeight = 500; Mat inputMat = new Mat(image.getHeight(), image.getHeight(), CvType.CV_8UC4); Utils.bitmapToMat(image, inputMat); Mat outputMat = new Mat(resultWidth,

Calculate absolute dimensions of a div rotated in perspective with css3

梦想的初衷 提交于 2019-11-29 06:17:41
问题 lets say we have a div with 500x500px size and we rotate it on the x axis via css 45 degrees considering a webkit-perspective value of 1600px. How would you calculate the absolute dimensions of the displayed trapezium? (width, max-height, angles) I did only figure out a formula that calculates the width but without considering the perspective, so the value differ some pixels (JavaScript): var absoluteWidth = Math.cos(45 * (Math.PI / 180)) * 500); EDIT: Here is the spec about the -webkit

Mode7-like perspective transform in canvas?

十年热恋 提交于 2019-11-28 20:36:27
问题 I'm making a canvas-based game engine and am wondering if anyone has any good info on how to achieve an overhead view perspective. What I'm looking for is somewhere halfway between the traditional birds eye view and the old SNES mode7 view. Just a slight angle to give the illusion of 3D. I'm trying to figure out what is going to be the best way to deal with the perspective skewing. I'm not doing rotations so 3D matrix stuff would be going overboard, but I need to be able to deal with

What is the value of BPM? (Business Process management) Is it worth using? In which cases? [closed]

爷,独闯天下 提交于 2019-11-28 17:34:33
And I'm not meaning Bits Per Minute, but Business Process Management. At first though BPM was overestimated, because the technology is somehow easy to address, but I've learned the value of BPM suites is in involving the non-technical, the business experts into the software design. I know, the user is always with us during analysis, but the artifacts we use are always very unfamiliar to them. No matter how friendly the UML diagram looks like, or how many Agile iterations we go into, there is always a gap between the final user and the final developer ( usually covered by the user manager and

Can you do an isometric perspective with HTML5 <canvas>?

喜欢而已 提交于 2019-11-28 16:35:35
It is possible to do an isometric perspective with HTML5 <canvas> ? It is with setTransform ? Or does it exist another way? Example: ctxt.setTransform (1, -0.2, 0, 1, 0, 0); Something like the perspective of Farmville. Thanks a lot. You can draw whatever you want on the canvas down to the individual pixel, so any question like "is it possible" will have a "yes" answer. If you mean if a 3d pipeline is already built-in in the canvas the answer is no, canvas context is 2d so commands are 2d. You can set up a matrix that will make your square-drawing commands looking like an isometric view, but