Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda