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

misbehaviour when adding some threejs objects to map #2

Open
am2222 opened this issue Mar 2, 2017 · 2 comments
Open

misbehaviour when adding some threejs objects to map #2

am2222 opened this issue Mar 2, 2017 · 2 comments

Comments

@am2222
Copy link

am2222 commented Mar 2, 2017

Hi,
I am very intrested into this project. I tried to add some trees to your sample project using this codes

`

		var dataSrc = 'data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAABkCAYAAAA14zjWAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wEOFSMFJi24rAAAFi5JREFUeNrdXHuQZFdZ/33ncR/9mtdOz+zsbtjsLgnshhgwFV7GiIi8lEJUBEERsKSAAAVBKxSGh6aEgCZBXlUWakqkCrUoLS0URYsiUAkYqEAICawhye5m57E7Mz3dPf24j3M+/zjdPT0z3TPd89iU3qqu6Xv69O3zO7/vfOf7fve7Q7iEx/XXX49CoSDOnj37QgBvBnAPM98FoPLggw9esnHIS/VDJ0+eBDN7jz322JuWl5fviKLouVrrF0gpDwL4TrFYXL1w4cL/H9BHjx6FECKcm5t7b6lU+uNqtXpgdXUVzWZTBUHwTK31cQD3FIvFyqUAvu+gjxw5At/3g4WFhfdVK9WbkzTJyryE8ASiWoR6vU5hGD7d87ynAPh6sVis7TfwfQV9+PBh5HI5b3Z29j31Wv19lmzoFT34Uz7UiAIYiKsxGvUGMpnM07TWYy3g0X4C3zfQR48exaFDh+Qjjzzylnq9/iEWnPWmPegxDQiAJEHlFdgw4kqMKIook8lcrZRSzPzNqampdL+Ai/246IkTJ/CFL3wBDz744OsajcYfs+S8f7DFLgFE5P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Oi8vL3RtcC9waHBXSTQ5SUkEYn8/AAAAAElFTkSuQmCC';
var	geometry = new THREE.Geometry();
    var image = document.createElement('img');
    image.src = dataSrc;
    var sprite = new THREE.Texture(image);
    sprite.needsUpdate = true;
    for (var i = 0; i < 20; i++) {
        var vertex = new THREE.Vector3();
        vertex.x = 2000 * Math.random() - 1000;
        vertex.y = 2000 * Math.random() - 1000;
        vertex.z = 50;
        geometry.vertices.push(vertex);
    }
   var material1 = new THREE.PointCloudMaterial({
        size: 20,
        sizeAttenuation: true,
        map: sprite,
        transparent: true,
        alphaTest: 0.5
    });
    // material.color.setHSL(1.0, 0.3, 0.7);
   var particles = new THREE.PointCloud(geometry, material1);
    particles.scale.set(.1, .1, .1);
    mapView.scene.add(particles);

It works fine but when I try to rotate map the background map shows some misbehaviors and it seems it does not load background tiles anymore. Can you please help me to debug it?
thanks

@am2222
Copy link
Author

am2222 commented Mar 2, 2017

I have tested and it seems the problem is because of updating threejs to last version, But I have no idea what cause this problem in new threejs

@am2222
Copy link
Author

am2222 commented Mar 2, 2017

Update:It seems threejs tries to resize 2d image materials into a power image.based on this link
makePowerOfTwo

and this link

textureNeedsPowerOfTwo

says that there has to be two options of
texture.minFilter== NearestFilter
or
texture.minFilter !== LinearFilter

set for material. I tried to add this line
material.minFilter = THREE.NearestFilter;
here
_loadZoomMaterial

but nothing changed. Only some of warnings disappeared, I think the material should change in somewhere else

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

1 participant