perspective

How to texture a random convex quad in openGL

浪子不回头ぞ 提交于 2019-12-06 07:37:55
Alright, so I started looking up tutorials on openGL for the sake of making a minecraft mod. I still don't know too much about it because I figured that I really shouldn't have to when it comes to making the small modification that I want, but this is giving me such a headache. All I want to do is be able to properly map a texture to an irregular concave quad. Like this: I went into openGL to figure out how to do this before I tried running code in the game. I've read that I need to do a perspective-correct transformation, and I've gotten it to work for trapezoids, but for the life of me I can

Converting OpenCV's findHomography perspective matrix to iOS' CATransform3D

拜拜、爱过 提交于 2019-12-06 05:13:44
问题 I'd like to take the perspective transform matrix returned from OpenCV's findHomography function and convert it (either in C++ or Objective-C) to iOS' CATransform3D . I'd like them to be as close as possible in terms of accurately reproducing the "warp" effect on the Core Graphics side. Example code would really be appreciated! From iOS' CATransform3D.h: /* Homogeneous three-dimensional transforms. */ struct CATransform3D { CGFloat m11, m12, m13, m14; CGFloat m21, m22, m23, m24; CGFloat m31,

3D rotation - perspective

纵然是瞬间 提交于 2019-12-06 03:46:51
问题 public class MainActivity extends Activity { LinearLayout rotator; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); rotator = (LinearLayout) findViewById(R.id.rotator); ObjectAnimator rotation = ObjectAnimator.ofFloat(rotator, "rotationY", 0, 360); rotation.setDuration(3000); rotation.start(); } } I've got above code, which is rotating View around Y axis. Problem is, that the perspective seems to be too "strong" -

I can't see Aptana Perspective in Eclipse

我是研究僧i 提交于 2019-12-05 07:18:34
I can't see Aptana perspective after install Aptana Studio 3 plug-in version in Eclipse 13.7 (Indigo). The plug-in is installed but i can't choose aptana perspective in Eclipse... When I'm installig Aptana Studio 2 everything is ok... In Studio 3, it's called Web perspective. 来源: https://stackoverflow.com/questions/7787565/i-cant-see-aptana-perspective-in-eclipse

Perspective Coords for 2D Hex Grid

时光怂恿深爱的人放手 提交于 2019-12-04 20:34:33
Here's a stumper... Porting some old code, I have this 2D hex grid being rendered in 2.5D: The y-scale & position of the tiles is calculated for perspective, but I'd like to scale & position them for perspective horizontally as well (the toons at the top of the board look squished). Here's the current code: const SCALE_X = PixiStages.game._width * 0.0012; const SCALE_Y = PixiStages.game._height * 0.0018; this.scale.x = SCALE_X; this.scale.y = SCALE_Y * ( 0.5 + 0.5 * gamePiece.y / Game.TILE_ROWS ); const getStageXFromBoardX = ( board_x ) => { const tileWidth = SCALE_X * 38; return board_x

How to fix image perspective distortion and rotation with JavaScript?

Deadly 提交于 2019-12-04 13:12:49
问题 I have some images that takes using mobile phone. Is there any JavaScript library which can straighten the photo of a paper and flatten it? For example I want to create a rectangular image without any distortion from this image. In the other words I want to know how to fix perspective distortion and rotation with JavaScript? For example I found below sample image from this article: How to fix this type of image with javascript? 回答1: Looks like https://www.npmjs.com/package/perspective

Converting OpenCV's findHomography perspective matrix to iOS' CATransform3D

回眸只為那壹抹淺笑 提交于 2019-12-04 12:50:58
I'd like to take the perspective transform matrix returned from OpenCV's findHomography function and convert it (either in C++ or Objective-C) to iOS' CATransform3D . I'd like them to be as close as possible in terms of accurately reproducing the "warp" effect on the Core Graphics side. Example code would really be appreciated! From iOS' CATransform3D.h: /* Homogeneous three-dimensional transforms. */ struct CATransform3D { CGFloat m11, m12, m13, m14; CGFloat m21, m22, m23, m24; CGFloat m31, m32, m33, m34; CGFloat m41, m42, m43, m44; }; Similar questions: Apply homography matrix using Core

3d Navbar That Rotates

旧街凉风 提交于 2019-12-04 11:52:18
问题 I'm trying to create a 3d navbar using pure CSS with transforms, transitions and perspective. Here is my code: .navbar-fixed-bottom { background: transparent; } .navbar-perspective { width: 100%; height: 100%; position: relative; -webkit-perspective: 1100px; -moz-perspective: 1100px; perspective: 1100px; -webkit-perspective-origin: 50% 0; -moz-perspective-origin: 50% 0; perspective-origin: 50% 0; } .navbar-perspective > div { margin: 0 auto; position: relative; text-align: justify; -webkit

3D rotation - perspective

感情迁移 提交于 2019-12-04 07:35:15
public class MainActivity extends Activity { LinearLayout rotator; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); rotator = (LinearLayout) findViewById(R.id.rotator); ObjectAnimator rotation = ObjectAnimator.ofFloat(rotator, "rotationY", 0, 360); rotation.setDuration(3000); rotation.start(); } } I've got above code, which is rotating View around Y axis. Problem is, that the perspective seems to be too "strong" - the edge of view that is in foreground becomes too big and the edge in background becomes too small.

Perspective transformation with GD

不羁的心 提交于 2019-12-04 05:42:52
How can I apply a perspective transformation on an image using only the PHP GD library? I don't want to use a function someone else made I want to UNDERSTAND what's going on I honestly don't know how to describe mathematically a perspective distortion. You could try searching the literature for that (e.g. Google Scholar ). See also in the OpenGL documentation, glFrustum . EDIT : Interestingly, starting with version 8, Mathematica has a ImagePerspectiveTransformation . In the relevant part, it says: For a 3*3 matrix m , ImagePerspectiveTransformation[image,m] applies LinearFractionalTransform[m