Questions tagged [perspectivecamera]

Perspective camera projection projects points onto the image plane along lines that emanate from a single point, called the center of projection. This means that an object has a smaller projection when it is far away from the center of projection and a larger projection when it is closer.

Perspective Projection describes the mapping from 3D points in the world as they are seen from of a pinhole camera, to 2D points on a viewport.

At perspective projection the viewing volume is a frustum (a truncated pyramid), where the top of the pyramid is the viewing position.

418 questions
3
votes
2 answers

How to set initial camera position (Three.js/VR)?

If I do not set initial position to the camera, the WEB borwser and Oculus Go browser behave differently (see images below). const camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 ); // camera position is Vector3(0, 0, 0) scene.add(…
Roman Mahotskyi
  • 4,576
  • 5
  • 35
  • 68
3
votes
1 answer

OpenCV: Confusion about solvePnP

I have a small confusion regarding the use of the solvePnP function in OpenCV. I have the matrix for the intrinsic parameters of the camera and I have identified some keypoints in image and I am trying to estimate the extrinsic parameters for the…
Luca
  • 10,458
  • 24
  • 107
  • 234
3
votes
1 answer

Applying a perspective transformation matrix from GIMP into a GLSL shader

So I'm trying to add a rotation and a perspective effect to an image into the vertex shader. The rotation works just fine but I'm unable to make the perspective effect. I'm working in 2D. The rotation matrix is generated from the code but the…
Winter
  • 3,894
  • 7
  • 24
  • 56
3
votes
1 answer

OpenGL Perspective Projection pixel perfect drawing

The target is to draw a shape, lets say a triangle, pixel-perfect (vertices shall be specified in pixels) and be able to transform it in the 3rd dimension. I've tried it with a orthogonal projection matrix and everything works fine, but the shape…
Met
  • 103
  • 1
  • 1
  • 7
3
votes
1 answer

How to transform an Android bitmap to wrap a cylinder and change perspective

I wrote a sample app that allows the Android user to take a picture and have the text content from a view as an overlay on the image and saved to a gallery album: What I would like to to is transform the text bitmap before joining the two images. …
Dale
  • 5,520
  • 4
  • 43
  • 79
3
votes
0 answers

Using CATransform3DRotate with perspective: how to correct the 2D size increase?

I'm trying to create a paper folding effect in Swift using CALayers and CATransform3DRotate. There are some libraries out there, but those are pretty outdated and don't fit my needs (they don't have symmetric folds, for example). My content view…
3
votes
0 answers

Image Rectification from single camera using two points

I'm trying to implement image rectification. I was using a software which is not available anymore. To rectify the image, the software used the height of the camera (h), the distance of two points (d1, d2) from the camera and the correspond lines in…
ArLe
  • 31
  • 3
3
votes
2 answers

How to tween a camera to an object in three.js?

I've created some objects in my scene, and set up raycasting/tweening code so that whenever I click on an object, the object animates directly to the position and rotation of the camera. This is my code for raycasting/tweening the object: function…
qbuffer
  • 383
  • 4
  • 14
3
votes
1 answer

How to controll perspective distortion of THREE.PerspectiveCamera

My goal is to render collada object and place it perfectly over image with this object. Lets say that I have image that was rendered by v-ray renderer in 3ds max (green one) and collada object that I render by three js using perpective camera (red…
Andrii Tsarenko
  • 655
  • 7
  • 21
3
votes
1 answer

How to recreate the Three.js OrbitControl movement on mouse move?

I would like to recreate the Three.js OrbitControl movement without the click & drag, i.e. simply making the camera following mouse movement. I tried to recreate it from scratch, but it was too much effort as the problem is that the camera moves on…
a.barbieri
  • 2,398
  • 3
  • 30
  • 58
3
votes
1 answer

SceneKit - Get camera default field of view

How can I get the X and Y fields of view used by a SceneKit camera by default? Per the docs, by default camera.yFov and camera.xFov are 0, and SceneKit uses 60 degrees for yFov and automatically adjust xFov. Any idea on how I can get the…
Guig
  • 9,891
  • 7
  • 64
  • 126
3
votes
2 answers

Why does graphics pipeline need mapping to clip coordinates and normalized device coordinates?

On perspective projection, if I use simple projection matrix like: 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1/near 0 , which is just projecting onto the image plane. It can be easily get view space coordinates by discarding and normalizing, I think. If on…
Hyunan Kwon
  • 545
  • 1
  • 4
  • 14
3
votes
2 answers

in opengl why do we have to do gluPerspective before gluLookAt?

so under GL_PROJECTION I did glu.gluPerspective(90,aspect,1,10); glu.gluLookAt(0,0,3,0,0,0,0,1,0); this works fine but when I switch the order I don't get any object on my screen, I rotated my camera and theres nothing. I know that…
3
votes
1 answer

LibGDX - perspective camera smooth translation & direction

I am trying to implement smooth 3D camera in my game. So, I have a few reserved positions and directions and I want to change view of my camera by applying them to my camera. Now I am doing it like below: //Reserved positions and directions //View…
Nolesh
  • 6,848
  • 12
  • 75
  • 112
3
votes
1 answer

OpenGL Frustum Pedagogy

i've been drawing directly into homogenous clip space (the 2x2x2 cube centered around 0,0,0) in opengl and i've realized that the perspective transformation matrix transforms all geometry from one right-parallelipid (view-space) to another…
user755921