indiesoftby / defold-scene3d

Scene3D is a collection of scripts, materials and tools to help you develop 3D games with the Defold game engine.
https://indiesoftby.github.io/defold-scene3d/
MIT License
132 stars 8 forks source link

Camera3d throwing error when rotation X is exactly -90 #23

Closed RomanPoschl closed 2 years ago

RomanPoschl commented 2 years ago

Describe the bug Hello when I tried camera3d, it is throwing error when rotation X is exactly -90. I tried to debug it and it looks like Error is in render3d.lua . viewport.view_right has vector3 with nan values.

image

To Reproduce Steps to reproduce the behavior: image

  1. Run the game

Expected behavior Show sphere

Hardware (optional)

Additional context (optional) Error:

ERROR:SCRIPT: scene3d/render/render3d.lua:98: argument #1 contains one or more values which are not numbers: vmath.vector3(nan, nan, nan)
stack traceback:
  [C]:-1: in function cross
  scene3d/render/render3d.lua:98: in function view_direction
  scene3d/camera/camera3d.script:32: in function update_render
  scene3d/camera/camera3d.script:70: in function <scene3d/camera/camera3d.script:68>
aglitchman commented 2 years ago

Thanks!

Fixed in https://github.com/indiesoftby/defold-scene3d/commit/552a8e1ef94baecba5cd7c7ce7f35f1193596ab0

RomanPoschl commented 2 years ago

@aglitchman No problem. I am glad that I can somehow help you. Also, I decided that I will try to create a 3D game so. Probably you can expect more things from me.