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

dilateGeometry does not work with on sphere vertexes #3

Open
LucianNovo opened this issue Jun 6, 2014 · 2 comments
Open

dilateGeometry does not work with on sphere vertexes #3

LucianNovo opened this issue Jun 6, 2014 · 2 comments

Comments

@LucianNovo
Copy link

No description provided.

@ghost
Copy link

ghost commented Feb 8, 2016

I have been messing around with this issue as well, in the threex.dilateGeometry.js, I added this to make it work

    geometry.vertices.forEach(function(vertex, idx){

            /* added this if statement to make it work*/
        if(typeof(vertexNormals[idx])!=='undefined') {


            var vertexNormal = vertexNormals[idx];
            vertex.x += vertexNormal.x * length;
            vertex.y += vertexNormal.y * length;
            vertex.z += vertexNormal.z * length;

        }
    });     
};`

@aidv
Copy link

aidv commented Apr 19, 2017

I had the same problem, I solved it doing the following

geometry.vertices.forEach(function(vertex, idx){
		var vertexNormal = vertexNormals[idx];
		if (vertexNormal != null){
			vertex.x	+= vertexNormal.x * length;
			vertex.y	+= vertexNormal.y * length;
			vertex.z	+= vertexNormal.z * length;
		}
	});		

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