Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThreeJS 网格动画Bug~ [附带修复代码] #133

Open
whh8162880 opened this issue Mar 27, 2020 · 2 comments
Open

ThreeJS 网格动画Bug~ [附带修复代码] #133

whh8162880 opened this issue Mar 27, 2020 · 2 comments

Comments

@whh8162880
Copy link

whh8162880 commented Mar 27, 2020

网格动画 生产 播放的时候显示异常

修复如下

ThreeSlot.ts line: 272

for (let i = 0, l = vertexCount; i < l; ++i) {

let iD = i * 2

const vertex = ThreeFactory.create(ThreeFactory.POOL_TYPE_VECTOR3) as THREE.Vector3;
const uv = ThreeFactory.create(ThreeFactory.POOL_TYPE_VECTOR2) as THREE.Vector2;
vertices.push(vertex);
uvs.push(uv);
uv.set(

floatArray[uvOffset + iD],

floatArray[uvOffset + iD + 1]

);
vertex.set(

floatArray[vertexOffset + iD] * scale,

floatArray[vertexOffset + iD + 1] * scale,

0.0
);

**ThreeSlot.ts line:464 **

for (let i = 0, l = vertexCount * 2; i < l; i += 2) {
const x = floatArray[vertexOffset + i] * scale + deformVertices[i];
const y = floatArray[vertexOffset + i + 1] * scale + deformVertices[i + 1];

const vertex = vertices[i / 2];

if (isSurface) {
.......

**ThreeSlot.ts line 452

else if (hasDeform) {

geometry.verticesNeedUpdate = true;

const isSurface = this._parent._boneData.type !== BoneType.Bone;

@whh8162880 whh8162880 changed the title ThreeJS 网格动画Bug~ ThreeJS 网格动画Bug~ [附带修复代码] Mar 27, 2020
@whh8162880
Copy link
Author

whh8162880 commented Mar 27, 2020

虽然不报错了 但是网格动画表现的还是没有egret好

@FlySkyPie
Copy link

I trying import some animation to Three.js runtime, and got glitch, this patch save the day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants