Git Product home page Git Product logo

Comments (4)

qibu111 avatar qibu111 commented on June 3, 2024

我这是重新给他设置了一下:
var position = this.transform.position;
var euler = this.transform.euler;
this.transform.parent = ball.transform;
this.transform.position = position;//重新设置下位置
this.transform.euler = euler;//重新设置下旋转

from egret3d.

akdcl avatar akdcl commented on June 3, 2024

感谢,这个 bug 将在 1.3 版本修复

from egret3d.

Errol1017 avatar Errol1017 commented on June 3, 2024

我这是重新给他设置了一下:
var position = this.transform.position;
var euler = this.transform.euler;
this.transform.parent = ball.transform;
this.transform.position = position;//重新设置下位置
this.transform.euler = euler;//重新设置下旋转

感谢!解决了上面的问题,但是我似乎又发现了一个问题:
场景中有两级组件:空 GameObject parent > cube ; 两个组件都在世界坐标系原点;
1,绕y轴:parent 绕世界原点 绕世界坐标系 y 轴 旋转 -10度;parent.rotateAngleAround(egret3d.Vector3.ZERO, egret3d.Vector3.UP, -10) ;
此时:parent.localEulerAngles = (0,-10,0);parent.eulerAngles = (0,-10,0);
cube.localEulerAngles = (0,0,0);cube.eulerAngles = (0,-10,0);
这是绕世界坐标系y轴的情况,这种情况似乎是没问题的;
2,绕x轴:parent 绕世界原点 绕世界坐标系 x 轴 旋转 10度;
parent.rotateAngleAround(egret3d.Vector3.ZERO, egret3d.Vector3.RIGHT, 10) ;
此时:parent.localEulerAngles = (10,0,0);parent.eulerAngles = (10,0,0);
cube.localEulerAngles = (0,0,0);cube.eulerAngles = (90,0,0);
此时绕 世界坐标系x轴旋转的度数: 大概 >1.25度时,cube.eulerAngles.x 一直是 90 ;0 - 1.25度 ,cube.eulerAngles.x 快速增加,没看出这两个值是什么关系。。
这里应该有问题
3,单独绕z轴,也是没问题的,但是只要加入绕 x 轴旋转,就会有问题;
4,这里的源码涉及matrix看不懂了,希望能给我修正后的代码,我在这里卡住了。。
5,再次感谢!

from egret3d.

Errol1017 avatar Errol1017 commented on June 3, 2024

新版本后以上问题都已解决。

from egret3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.