Questions tagged [camera]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
19 views

Mapping a box to an inverse frustum

I have a non AA, non cubic, box living happily in 3D. I have a frustum defined by 2 squares. one square is the square defined by [-1, 1]^2 and the other square can have any size, there is also a ...
  • 1,594
0 votes
0 answers
44 views

Trouble getting a raytracer camera representation for different aspect ratios

I am trying to make my camera representation work for images whose aspect ratio isn't 1 (640x480, 1920x1080...), but I am having some trouble getting it to work. The camera model is pretty simple, as ...
  • 101
0 votes
1 answer
59 views

OpenGL - How to increase view space coordinate range in X and Y axis

I'm trying to render some objects but apparently X and Y coordinates need to be really small in-order to get something on screen. See this example of 2 lines The world space coordinates for these ...
2 votes
0 answers
78 views

Finding Camera projection matrix from known input and output

Lets say I have a rectangle with known coordinates in 3D scene, and I'm projecting it using pin point camera to the plane (screen). You can imagine it deforms on the screen per camera transformation ...
1 vote
0 answers
103 views

Understanding camera of a CPU raytracer from "Ray tracer challenge"

I am following a book "Ray tracer challenge" by Buck, but it doesn't explain anything. The code works, but I don't properly understand, why. The code is as follows: ...
  • 121
0 votes
0 answers
60 views

Using Perspective Rendering To Render A 3D Point

I am wondering how I can use perspective rendering to render a point onto a screen. An image showing perspective rendering: Say I have a 3d point (with x, y, and z coordinates), a point for the ...
0 votes
0 answers
97 views

How to get world coordinates from a 4X4 camera matrix

I have Intel T265 camera which has a camera coordinates system like following diagram: The camera system has two cameras and the center of the two cameras is the position of the camera system. The ...
0 votes
1 answer
47 views

How to ensure that a randomly-generated velocity vector moves the camera forward within a valid arc?

I spawn a camera in a scene using random coordinates for x and y and setting z=0 and orient ...
  • 241
0 votes
1 answer
104 views

How compute new camera parameters given a velocity vector?

My goal is to update camera parameters given a velocity vector so that the camera points in the direction of the velocity vector. How should one compute the update matrix for the camera parameters?
  • 241
0 votes
0 answers
144 views

Ray casting and rasterization 101

Recently I've became an intern in company-name and my internship task is(for now) create rasterization using rays. I'm mostly interested in pure math, so basic ...
1 vote
1 answer
165 views

How to use trackball for rotating an camera matrix in eye frame

I have a QOpenGLWidget where I use camera transformation matrix(4,4), FOV and vectors Position(4), Up(4), Forward(4). I also have an ArcBall which I can use. I managed to implement zoom and pan by ...
  • 111
0 votes
1 answer
1k views

Given two 3d vectors, find the rotation matrix between the two

So I am making a raytracer following the very helpful online book of Gabriel Gambetta but I stumble on the rotation matrix part. My linear algebra background is 3Blue1Brown video series "The ...
  • 103
0 votes
1 answer
97 views

Magic number meaning in smallpt's camera ray calculation

In smallpt's source at line 90 the direction is multiplied by 140 and I was wondering where that number is coming from. I was hoping for it to be explained in the ...
1 vote
1 answer
38 views

Does angular diameter to FoV ratio equal object's image to total image ratio?

If we have an object at certain distance D in front of a camera. The object has a horizontal diameter d, giving us an angular diameter theta (2*arctan(d/2D)) of 50 degrees (converted from radians). ...
  • 115
0 votes
4 answers
135 views

Does an object spanning percentage of the Camera's FoV correlate with the object's image percentage?

I am working on a virtual camera inside a game engine, which provides me with an FoV control, but no Focal length control (and no filming sensor dimensions short of aspect ratio), and I am less than a ...
  • 115
4 votes
0 answers
140 views

Project grid on 2d plane based on camera perspective

Unsure if this is the right network to post this, but maybe someone can help... I'm working on a personal project where, with the help of AI, I want to automatically estimate the perspective of a ...
  • 41
1 vote
0 answers
44 views

What's the name of the transformation that can remove horizontal convergence from a picture?

Say that you are taking pictures from a street like this one: As you can see, the picture is taken perpendicular to the direction of the street. The problem is that cars at the left look as if they ...
0 votes
1 answer
95 views

Sensor size of Sony HDR-HC7e

I want to motion track a shot from my Sony HDR-HC7e camcorder and I am not quite sure about the horizontal sensor size(width). I set the focal length to minimum and the recording to HDV 16:9 This ...
2 votes
1 answer
87 views

Calculate the position and rotation needed to have a camera look at a certain region

I have a 2D region defined by 4 points in 3D space. I want to position my camera so that it looks at the region, with a settable variable determining which side it looks at, where looks at means that ...
3 votes
1 answer
1k views

How to keep an object constant in screen space?

If you open the modern Blender UI and select for example scaling, and then you use the scroll wheel to "zoom" (move the camera along the radial axis). You will notice that the size of the 3D widget ...
  • 1,594
0 votes
1 answer
127 views

Apply Projective Transformation 2D Rectangle

I want to write code from scratch about Projective Transformation in order to apply this transformation to 2d rectangular. I searched about this transformation, but I could not figure out completely. ...
user avatar
1 vote
0 answers
76 views

How to Pan Zoom a spherical camera?

I asked this in regular SO but I think people are not understanding the question so i will try here: So, for anyone familiar with Google Maps, when you zoom, it does it around the cursor. That is to ...
  • 1,594
0 votes
1 answer
751 views

Perspective Raytracing

Given the up and focal vector of the perspective camera, the position of the camera and the vertical and horizontal opening angle of the FOV. How can I calculate a ray for given screen space ...
  • 115
0 votes
1 answer
116 views

How can I reproduce the MatchMoving/MotionTracking technique from Just Dance?

I'm a software engineer student with a big projet idea but low graphic knowledge. My goal is to compare two people dancing. One person would be the teacher with perfect moves and the other would be a ...
2 votes
1 answer
476 views

Difference between a spherical camera and a trackball camera

A spherical camera is pretty easy to define. We have an anchor point C the camera always looks at and a relative position P where the camera is, which can be expressed in spherical coordinates, ...
  • 1,594
2 votes
1 answer
269 views

Camera Implementation without Limitations

I've developed a simple (Third-Person) Perspective Camera with Orbit controls. However, my implementation doesn't handle the case where if the pitch goes over 90º it flips upside down. From what I've ...
0 votes
1 answer
528 views

Can pixels on the image plane be mapped to world space coordinates?

I'm trying to learn the fundamentals of 3d computer graphics by writing a toy framework in WebGL. I'm currently working on mouse based camera controls. There are plenty of good resources in the ACM ...
  • 103
4 votes
1 answer
658 views

Camera Model View transformation in Ray Tracing

I am implementing my own simple ray tracing and I came across some sort of confusion. When defining the verticies in the world I multiply them by the modelView transformation system (the matrix ...
4 votes
1 answer
226 views

Modify camera matrix so that it renders a "chunk" of the frustum

Given a perspective projection matrix. How can one from it derive a set of matrices representing "chunks" of the viewport? So that the rendered chunks can be "stiched" to form an image "chunk times ...
  • 41
0 votes
1 answer
615 views

Translate an arcball camera upwards or left-right

This problem is giving me a really hard time. I'm always looking at the origin and have a camera that moves around it in an arcball mode. That part works beautifully: I'm calculating the camera ...
7 votes
1 answer
596 views

How to match Blenders polynomial lens distortion model with GLSL?

I'm trying to re-implement Blenders (libmv) polynomial lens distortion model using shadertoy, in order to apply the lens distortion in another application ideally by generating a STMap for that. I ...
0 votes
1 answer
2k views

Understanding of Camera Up Vector

Assume eye position e, gaze direction g, view-up vector t, right-handed base. As the graphs shows: $w=-\frac{g}{||g||}$ $u=\frac{t\times w}{||t\times w||}$ $v=w\times u$ I am really confused ...
  • 237
1 vote
0 answers
129 views

Compute emitted importance of a pinhole camera

In section 16.1.1 of Physically Based Rendering the authors describe how we can check, if a given ray $r$ corresponds to one starting from the film area. They implement this check such that it works ...
  • 183
1 vote
1 answer
74 views

Equation for camera projection

I am trying to find an equation for a camera projection. The goal is to map the point $P(P_x, P_y, P_z)$ from the world coordinates onto the window coordinates $Q(Q_x, Q_y)$. The eye of viewing is ...
  • 113
4 votes
1 answer
247 views

Deriving blur from real optical formulae

Looking at the Wikipedia page for Circle of Confusion, and at such posts as this one, I completely understand how to calculate the values for near, far, focal planes and hyperfocal distance. I am also ...
4 votes
1 answer
714 views

Computing a lookAt matrix by passing a vec3 to a camera object

I am following this tutorial on how to implement a first person camera. So far I was able to implement the entire (C++) class in TypeScript and it works as it is supposed to. Problem What I was not ...
2 votes
1 answer
52 views

Correctness or otherwise of the procedure for generating an orbiting camera in WebGl

I have to create a orbiting camera. I created the model of sun (a sphere) around (0,0,0) , triangulated and Phong shaded it. I would have a camera that goes around the sun thus an orbiting camera and ...
  • 321
0 votes
1 answer
849 views

How to rotate a camera?

So I am doing a simple FPS camera with openGL. I store the camera as 4 vector, a position vector, a lookAt vector, an up vector and a right vector. When the user presses a key, I create a rotation ...
3 votes
1 answer
519 views

Creating depth map from a 2-D image?

My question is oriented towards the generation of depth map using any of the state of the art depth sensor. However, each of these method required the presence of an 3-D object in front of the sensor....
  • 131
-3 votes
2 answers
98 views

How does cell phone display image or video even before you start to capture?

When a cell phone is used to take a photo or capture video the display continuously displays what a camera can see, does that mean the ccd/cmos device is exposed to light continuously? or is it ...
2 votes
1 answer
469 views

How to calculate camera distance so that after projective transformation a quad is filling the whole screen

First of all, I'm using OpenGL and GLM. Now, I have a square perpendicular to the z-axis and centered around it. Let's say that it has Z-value (offset along the Z-axis) X. Now, I want to set up a ...
3 votes
1 answer
2k views

Please, help me to understand why my raytracing camera rotates in wrong directions?

I'm trying to build a raytracer and I use this article on how to build camera system. The problem is that when, after calculating ray direction in camera space, I multiply it by camera-to-world ...
  • 31
2 votes
2 answers
777 views

How to get camera Right vector when Front vector and WorldUp vector are collinear

Get the title problem when implementing a walkthrough camera. I use normlize(cross(WorldUp, Front)) to get Right vector. And when they are collinear, I get a zero vector. Is there any more robust ...
  • 21
2 votes
0 answers
93 views

Why does the camera not remain child of the other camera after adding it in osg?

I am writing an OpenSceneGraph based program that uses two cameras, one to render the preview for the user and one that uses a callback to make screenshots with MRT. The exporter camera is using an ...
  • 1,477
4 votes
1 answer
2k views

Render with camera perspective off-center

So ordinarily we have this But I'm after this! Is it possible to do this? Ideally by changing the projection matrix? The reasoning is kinda interesting - I am developing for mobile VR, and I have ...
3 votes
0 answers
208 views

Calculate Camera parameters and HandEyeCalibration

I'm trying to calculate camera paramters and a hand eye calibration (Transformation from camera to eye (display) coordinates) for rendering on a see-through HMD. I have already calculated a ...
1 vote
1 answer
1k views

Understanding camera() settings in Processing

I have trouble understanding the way a camera is set in Processing (according to the reference this shoudn't be very different from OpenGl). For starters, when I set the eye position of the camera I ...
2 votes
0 answers
164 views

With OpenGL, is it correct to apply model transformation to rotate the camera?

Having taken a basic CG course, I remember that transformations are relative, so rotating the camera is identical to rotating the view in the opposite direction. Right now I want to implement camera ...
6 votes
1 answer
3k views

Depth of Field in Path Tracing: What do I do with the secondary ray?

How can I implement Depth of Field in my Path Tracer? I have read this article which explains the theory behind everything & I already have a good understanding of what this effect needs to ...
  • 2,463