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

laya.d3.js中createQuad的坐标是错误的,源码中是对的 #53

Closed
hantaogo opened this issue Oct 9, 2019 · 1 comment
Closed

Comments

@hantaogo
Copy link

hantaogo commented Oct 9, 2019

laya.d3.js 29609行

	    static createQuad(long = 1, width = 1) {
	        var vertexDeclaration = VertexMesh.getVertexDeclaration("POSITION,NORMAL,UV");
	        var vertexFloatStride = vertexDeclaration.vertexStride / 4;
	        var halfLong = long / 2;
	        var halfWidth = width / 2;
29609	var vertices = new Float32Array([halfLong, halfWidth, 0, 0, 0, 1, 0, 0, halfLong, halfWidth, 0, 0, 0, 1, 1, 0, -halfLong, -halfWidth, 0, 0, 0, 1, 0, 1, halfLong, -halfWidth, 0, 0, 0, 1, 1, 1]);
	        var indices = new Uint16Array([0, 1, 2, 3, 2, 1]);
	        return PrimitiveMesh._createMesh(vertexDeclaration, vertices, indices);
	    }

源码中的坐标是对的,js中halfLong前面少一个负号

29609	var vertices = new Float32Array([-halfLong, halfWidth, 0, ......
@hantaogo hantaogo changed the title laya.d3.js中createQuad的坐标是错误的,源码中时对的 laya.d3.js中createQuad的坐标是错误的,源码中是对的 Oct 9, 2019
@GuoLei1990
Copy link
Contributor

之前的版本确实出现了错误,源码已经修正,在后续发布的版本会更新

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