cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.42k stars 1.96k forks source link

camera3d.convertToUINode cannot be invoked in start #12261

Open Zhmz opened 2 years ago

Zhmz commented 2 years ago

Cocos Creator version

3.6.1

System information

All

Issue description

image the start function might do some preparation. So the calculation might be not accurate.

Relevant error log output

No response

Steps to reproduce

  1. invoke camera3d.convertToUINode in start and in update
  2. compare these results

Minimal reproduction project

No response

yeshao2069 commented 1 year ago

Forum Links https://forum.cocos.org/t/topic/138254

SantyWang commented 1 year ago

确实有问题,跟踪了一下发现,在 start 中执行此方法时,相机的矩阵数据不对,当延迟一帧后,相机的矩阵数据正常了

start 阶段中相机的 vp 矩阵 image

延迟一帧后的 vp 矩阵 image

因为这里不一样,导致 worldToScreen 计算结果出错。 猜测与相机的初始化有关

BenoitFreslon commented 1 year ago

Hello, we still have this issue in Cocos Creator 3.8.0