Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

169
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda