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
4
votes
2 answers

OpenGL Perspective Matrix in Python

I am trying to build a perspective transformation matrix in python for use with pyOpenGL. My view and model transformations are working but when I apply my projection transformation I get a blank screen (should be seeing a triangle at the origin…
Francis
  • 1,151
  • 1
  • 13
  • 29
4
votes
1 answer

Initial Sprite Size in Three.js

Can someone help me understand how three.js initially determines the size/scale of a sprite? At the moment I'm working with 4 sprites (PNGs with transparency that are 3000px × 1830px) stacked in 3D space, but I'm having to scale them up between 16x…
ironoxidey
  • 143
  • 1
  • 8
4
votes
3 answers

Switching OpenGL to perspective mode on top of a half rendered orthographic scene?

We have a mostly 2D game that runs in orthographic mode, but one part shows a 3d model that is rendered in between the other 2D objects. How can I switch to perspective mode, render that model, then switch back to render the other objects in…
Sam Washburn
  • 1,817
  • 3
  • 25
  • 43
4
votes
1 answer

CameraPosition and Lookdirection in WPF

I hope you all are doing very fine. I'm currently working on wpf application. I'm a newbie to wpf. I'm creating a scene which represents a lab in wpf. I'm having a very hard time with setting up camera. I don't know where the origin of camera starts…
Sikander Hayyat
  • 152
  • 1
  • 1
  • 11
4
votes
1 answer

How to make a perfect pinch zoom (Unity 3D)

I am searching for a solution to how to make a perfect pinch zoom in Unity by moving the camera along the forward: Set up: Horizontal plane centred at the origin with all Game objects. Perspective camera with FOV 10, offset at (10,10,10) looking…
4
votes
1 answer

Making an object fit exactly inside the camera frustum in Three.Js

I am trying to make an object fit inside the camera frustum, and I went through all the trigonometry for that, and this is the code I used. var setupCamera = function() { aspectRatio = window.innerWidth / window.innerHeight camera = new…
jhagege
  • 1,486
  • 3
  • 22
  • 36
4
votes
1 answer

LibGDX - restrict zooming of perspective camera

What is the best way to restrict zooming of perspective camera in LibGDX? I have a planet in space and I need to zoom in/out it. Zooming works great, but I have to limit it to prevent the planet to be so close to the user and far away from him. Now,…
Nolesh
  • 6,848
  • 12
  • 75
  • 112
4
votes
5 answers

raycasting: how to properly apply a projection matrix?

I am currently working on some raycasting in GLSL which works fine. Anyways I want to go from orthogonal projection to perspective projection now but I am not sure how to properly do so. Are there any good links on how to use a projection Matrix…
user240137
  • 693
  • 4
  • 10
  • 15
4
votes
2 answers

Moving objects parallel to projection plane in three.js

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…
oyophant
  • 1,294
  • 12
  • 23
4
votes
1 answer

Perspective Projection in Android in an augmented reality application

Currently I'm writing an augmented reality app and I have some problems to get the objects on my screen. It's very frustrating for me that I'm not able to transform gps-points to the correspending screen-points on my android device. I've read many…
Frame91
  • 3,670
  • 8
  • 45
  • 89
3
votes
1 answer

First Person Camera is not on the correct position

I am trying to create a first person camera in JavaFX based on bindings. The camera and the actual position both work perfectly. The only problem is that they don’t match! As you can see in the picture, the actual position (red box) is in the middle…
Darth Bane
  • 83
  • 7
3
votes
1 answer

OpenGL clips an object for no apparent reason

I'm trying to visualize a simple quad made of -1 to 1 vertices along x and y axis. Why opengl clips the object? The code seems correct to me glm::mat4 m = glm::translate(glm::mat4{1.0f}, toGlmVec3(objectPosition)); glm::mat4 v =…
IC_
  • 1,624
  • 1
  • 23
  • 57
3
votes
1 answer

Want to find rotation and position in perspective world of plane from 2d points in image

I have 2D png image I want to place a 3D plane at a perfect rotation and position of the sofa as shown in figure I am using three.js and a perspective camera to manually add the rotation and translation to the plane. I have the center and corner…
3
votes
1 answer

The cause of uncontrolled camera movement in a mode 7 affine transformation?

I am trying to implement a mode 7 effect with C and SDL2. Eventually, I hope to be able to do cool effects, like change the height and field of view. But for now, I just want to get something simple working. This is what I have so far: My problem…
3
votes
1 answer

X-Y-Distance from camera to object in vertex shader

I want to show some fog / aerial view in my application. But I only want to use the x,y world distance from camera to the model to determine the appearance. I already managed to get the signed z-distance from camera to the models with this…
User Rebo
  • 3,056
  • 25
  • 30