Hi all. I’m new al threejs. I’ve created earth with tranparent contur and aad with FOR 360180 spheres 2.22.2. And it’s very hard to render. I want to achive result like in https://2050.earth/.
Here my code:
let R = 605.5;
let geometry = new THREE.SphereGeometry(2.5, 2.5 );
let material = new THREE.MeshBasicMaterial( {
color: 0xffffff,
opacity: 1.0
} );
for (var lon = 0, lat=-89; lon < 360, lat <90; lon=lon+1) {
var phi = (90-lat)*(Math.PI/180);
var theta = (lon+180)*(Math.PI/180);
let xrad = -((605.5) * Math.sin(phi)*Math.cos(theta));
let zrad = ((605.5) * Math.sin(phi)*Math.sin(theta));
let yrad = ((605.5) * Math.cos(phi));
let plane = new THREE.Mesh(geometry,material);
plane.position.x = xrad;
plane.position.y = yrad;
plane.position.z = zrad;
group.add(plane);
planes.push(plane);
if ((lon >= 360)) {lat=lat+3; lon = 0;}
}
Hi!
Have a look at the documentation. THREE.Points() THREE.PointsMaterial()
Also, have a look into the Resources category of the forum. There you can find some stuff about your question.
Hi! Ive resolved problem with point, sorry 4 question, but how can i cut off points, wich are not in range of earth ground? eromulon.pro - result before cutting off. Thanks a lot!
And sorry for stupid questions, how can i displace points cross to the cross ? If i use just points without shader material, i just write 1 for cicle for that, but now i can.t understand.
No offense, but it seems that you have to put a little more effort for better understanding about how the things work: THREE.BufferGeometry(), THREE.BufferAttribute(), THREE.ShaderMaterial() and shaders, THREE.Texture() and UV coordinates.
Could you clarify it with a picture? Do you meant that points form crosswise lines?
From the scratch, you need to apply an angular shift (((PI * 2) / radialSegmentsCount) * 0.5) to every 2nd row of points, if we’re talking about points in a sphere geometry.
Sorry for nooby questions, i just need to do these dots like in https://i.imgur.com/s2rFHMQ.png with 0.5 offset, but cant understand how to make offset for each vertex