cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

camera3d.convertToUINode cannot be invoked in start

Open Zhmz opened this issue 3 years ago • 3 comments

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

Zhmz avatar Jul 29 '22 02:07 Zhmz

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

yeshao2069 avatar Feb 27 '23 03:02 yeshao2069

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

start 阶段中相机的 vp 矩阵 image

延迟一帧后的 vp 矩阵 image

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

SantyWang avatar Feb 27 '23 10:02 SantyWang

Hello, we still have this issue in Cocos Creator 3.8.0

BenoitFreslon avatar Oct 18 '23 14:10 BenoitFreslon

pr: https://github.com/cocos/cocos-engine/pull/18541

GengineJS avatar Mar 31 '25 06:03 GengineJS