Questions tagged [projection-matrix]

234 questions
2
votes
1 answer

ARkit - placing objects inside the camera filed of view

I will like to place 2 lines in the bounds of the current camera view as flow: Source - SceneKit docs From the ARKit docs, I understand that I need the projectionMatrix, but how can I calculate the diff from "zNear" to "zFar" and x\y? I'm starting…
Bar
  • 603
  • 1
  • 7
  • 19
2
votes
3 answers

Current OpenGL matrix mode

Is it possible to determine the current matrix mode used by OpenGL? For example, I currently have the following (triggered by a window resize): glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-width,…
nwn
  • 583
  • 7
  • 23
2
votes
2 answers

WebGL Perspective Projection Matrix

Can someone show me a function in javascript/webGL that will change 3d coordinates into 2d projected perspective coordinates? Thnx
ZachariahRS
  • 65
  • 2
  • 8
2
votes
1 answer

LWJGL Projection Matrix - Nothing Happens

Currently, I'm attempting to create a Camera class in LWJGL, but I've been running into a problem with the projection matrix. For some reason, when I try to multiply the vertices by the projection matrix, nothing at all appears on screen. Camera…
Spaxxy
  • 171
  • 1
  • 2
  • 6
2
votes
3 answers

OpenGL Projection Matrix

i try to get a basic OpenGL program working. I created two methods which create a modelview matrix (very rudimental at the moment, it only moves my object on the Z-Axis) and a projection Matrix. My proplem is, that as far as i understood OpenGL my…
Horstinator
  • 548
  • 1
  • 5
  • 18
2
votes
1 answer

How to approximate distance between given points?

I have the values P1,P2,P3,P4 with Screen-Points (x,y) and Longitude,Latitude. In addition to that, I have a camera (with lat,long), the height of the camera (1.6m (constant)) and the orientation of the camera (bearing, pitch, roll). I also have the…
Frame91
  • 3,670
  • 8
  • 45
  • 89
2
votes
1 answer

Perspective-projection matrix: how to calculate vertical FoV from just horizontal FoV and aspect-ratio?

Consider the following perspective-projection matrix which works (perfectly fine) with just vertical-field-of-view and aspect-ratio given by the caller: func (me *Mat4) Perspective (fovY, aspect, near, far float64) { tfY = near * math.Tan(fovY *…
metaleap
  • 2,132
  • 2
  • 22
  • 40
2
votes
0 answers

How to define MODELVIEW matrix in Open GL

I am doing Camera Calibration, and I have my intrinsic and extrinsic parameters. I have few virtual cameras, and need to draw frustums for each. I have almost solved that, finding out Projection matrix (m[int]*m[ext]=Projection Matrix), but I still…
SuTron
  • 387
  • 5
  • 16
2
votes
1 answer

How to convert opengl projection matrix between lhs and rhs?

I've got a lhs shader but happens to got a rhs projection matrix, how to convert between them?
user1349923
  • 763
  • 1
  • 7
  • 24
2
votes
1 answer

Using quaternions in Augmented Reality sample code "pARk" from Apple

I'm on an AR app for iOS for showing annotations on a camera view - like we all know from wikitude, junaio etc. I am new to this subject, so sorry for my stupid question :) I downloaded the "pARk" sample code from apple here to study how to…
1
vote
1 answer

glunproject cheaper alternative

I'm building a game in openframeworks where a camera moves over a stationary 2d plane in 3d space. I need to pick 5 coordinates for every frame as the camera is always moving (1 for the mouse and 4 for the corners of the viewport to workout what to…
Simon Katan
  • 706
  • 7
  • 11
1
vote
1 answer

iPad 2 back-facing camera field of view

I want to render virtual content over the camera image from the back-facing camera of the iPad 2. To achieve this, OpenGL ES is used to transform the content into the correct screen coordinates. projectionMatrix = …
Etan
  • 17,014
  • 17
  • 89
  • 148
1
vote
1 answer

Projection and View matrices to match the Kinect RGB camera perspective

Does anybody know what are the correct values to setup the projection and view matrix for a XNA rendering in order to match with the Kinect RGB camera? For example, if the skeleton head joint coordinates are (X,Y,Z) then if I draw a sphere at these…
Andrei Stanescu
  • 6,353
  • 4
  • 35
  • 64
1
vote
1 answer

CesiumJS: compute the projected size of the globe (in pixels)

We are using CesiumJS as an overlay in a spherical geometry app where it renders its own sphere with a known size (in pixels) and the user may zoom in/out to change its size. We would like to superimpose CesiumJS as another layer in the app and have…
dlmt
  • 166
  • 1
  • 11
1
vote
1 answer

LWJGL Projection Matrix not working (Quad remains the same even after multiplying with Projection Matrix)

I programmed a LWJGL 3 code to render a quad on the screen. I even added the projection Matrix to it, still I don't see any changes in the appearance of the quad. If I change the FOV of the frustum the quad gets smaller (that's what I expected) but…