Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
Recording and printing camera position in p5.js

I am using p5.js library and using the functionality of WebGL to make a 3d game. I want to record the z position of the camera and use it to obtain a certain output. Firstly, I wanted to know if there is a way to print the current x, y and z position of the camera. I created a variable first and created the camera var cam = createCamera() Then I used cam.move(x, y, z) to move the camera. Now, I want to get the position of the camera and print it. Further, I want to know the camera position to implement certain functions in the game. Is there a way to do this? Please do help me out in the same... Thank you in advance

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The p5.Camera class has a bunch of properties that describe its position and orientation:

Property Description
eyeX camera position value on x axis
eyeY camera position value on y axis
eyeZ camera position value on z axis
centerX x coordinate representing center of the sketch
centerY y coordinate representing center of the sketch
centerZ z coordinate representing center of the sketch
upX x component of direction 'up' from camera
upY y component of direction 'up' from camera
upZ z component of direction 'up' from camera

In this context, "the center of the sketch" is the position the camera is facing. See the reference for more info.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!