NEXTCODE1 Telegram 205
NEXT CODE
Video
سورس کد کره 👇


<!DOCTYPE html>
<html lang="fa">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>کره زمین</title>
<style>
body, html {
margin: 0; padding: 0; overflow: hidden;
background: black;
height: 100vh;
display: flex; justify-content: center; align-items: center;
}
#container {
width: 500px;
height: 500px;
}
</style>
</head>
<body>
<div id="container"></div>

<script src="https://photo2.tgoop.com/u/cdn.jsdelivr.net/npm/[email protected]/build/three.min.js"></script>

<script>
const container = document.getElementById('container');
const scene = new THREE.Scene();

const camera = new THREE.PerspectiveCamera(45, 1, 0.1, 1000);
camera.position.z = 3;

const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
renderer.setSize(500, 500);
container.appendChild(renderer.domElement);

const ambientLight = new THREE.AmbientLight(0xffffff, 0.7);
scene.add(ambientLight);

const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
directionalLight.position.set(5, 3, 5);
scene.add(directionalLight);

const geometry = new THREE.SphereGeometry(1, 64, 64);
const loader = new THREE.TextureLoader();

const earthTexture = loader.load('https://raw.githubusercontent.com/turban/webgl-earth/master/images/2_no_clouds_4k.jpg');

const bumpTexture = loader.load('https://raw.githubusercontent.com/turban/webgl-earth/master/images/elev_bump_4k.jpg');

const material = new THREE.MeshPhongMaterial({
map: earthTexture,
bumpMap: bumpTexture,
bumpScale: 0.05,
shininess: 10
});

const earth = new THREE.Mesh(geometry, material);
scene.add(earth);

let isDragging = false;
let previousMousePosition = { x: 0, y: 0 };
let rotation = { x: 0, y: 0 };

renderer.domElement.addEventListener('mousedown', function(e) {
isDragging = true;
previousMousePosition = { x: e.clientX, y: e.clientY };
});

renderer.domElement.addEventListener('mouseup', function() {
isDragging = false;
});

renderer.domElement.addEventListener('mousemove', function(e) {
if (isDragging) {
const deltaMove = {
x: e.clientX - previousMousePosition.x,
y: e.clientY - previousMousePosition.y
};
rotation.y += deltaMove.x * 0.005;
rotation.x += deltaMove.y * 0.005;
rotation.x = Math.min(Math.max(rotation.x, -Math.PI / 2), Math.PI / 2);
previousMousePosition = { x: e.clientX, y: e.clientY };
}
});

let autoRotateSpeed = 0.002;

function animate() {
requestAnimationFrame(animate);
if (!isDragging) {
rotation.y += autoRotateSpeed;
}
earth.rotation.y = rotation.y;
earth.rotation.x = rotation.x;
renderer.render(scene, camera);
}

animate();
</script>
</body>
</html>


اگه خوب هست ری اکشن بدید
👍21🔥1👏1



tgoop.com/nextcode1/205
Create:
Last Update:

سورس کد کره 👇


<!DOCTYPE html>
<html lang="fa">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>کره زمین</title>
<style>
body, html {
margin: 0; padding: 0; overflow: hidden;
background: black;
height: 100vh;
display: flex; justify-content: center; align-items: center;
}
#container {
width: 500px;
height: 500px;
}
</style>
</head>
<body>
<div id="container"></div>

<script src="https://photo2.tgoop.com/u/cdn.jsdelivr.net/npm/[email protected]/build/three.min.js"></script>

<script>
const container = document.getElementById('container');
const scene = new THREE.Scene();

const camera = new THREE.PerspectiveCamera(45, 1, 0.1, 1000);
camera.position.z = 3;

const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
renderer.setSize(500, 500);
container.appendChild(renderer.domElement);

const ambientLight = new THREE.AmbientLight(0xffffff, 0.7);
scene.add(ambientLight);

const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
directionalLight.position.set(5, 3, 5);
scene.add(directionalLight);

const geometry = new THREE.SphereGeometry(1, 64, 64);
const loader = new THREE.TextureLoader();

const earthTexture = loader.load('https://raw.githubusercontent.com/turban/webgl-earth/master/images/2_no_clouds_4k.jpg');

const bumpTexture = loader.load('https://raw.githubusercontent.com/turban/webgl-earth/master/images/elev_bump_4k.jpg');

const material = new THREE.MeshPhongMaterial({
map: earthTexture,
bumpMap: bumpTexture,
bumpScale: 0.05,
shininess: 10
});

const earth = new THREE.Mesh(geometry, material);
scene.add(earth);

let isDragging = false;
let previousMousePosition = { x: 0, y: 0 };
let rotation = { x: 0, y: 0 };

renderer.domElement.addEventListener('mousedown', function(e) {
isDragging = true;
previousMousePosition = { x: e.clientX, y: e.clientY };
});

renderer.domElement.addEventListener('mouseup', function() {
isDragging = false;
});

renderer.domElement.addEventListener('mousemove', function(e) {
if (isDragging) {
const deltaMove = {
x: e.clientX - previousMousePosition.x,
y: e.clientY - previousMousePosition.y
};
rotation.y += deltaMove.x * 0.005;
rotation.x += deltaMove.y * 0.005;
rotation.x = Math.min(Math.max(rotation.x, -Math.PI / 2), Math.PI / 2);
previousMousePosition = { x: e.clientX, y: e.clientY };
}
});

let autoRotateSpeed = 0.002;

function animate() {
requestAnimationFrame(animate);
if (!isDragging) {
rotation.y += autoRotateSpeed;
}
earth.rotation.y = rotation.y;
earth.rotation.x = rotation.x;
renderer.render(scene, camera);
}

animate();
</script>
</body>
</html>


اگه خوب هست ری اکشن بدید

BY NEXT CODE


Share with your friend now:
tgoop.com/nextcode1/205

View MORE
Open in Telegram


Telegram News

Date: |

But a Telegram statement also said: "Any requests related to political censorship or limiting human rights such as the rights to free speech or assembly are not and will not be considered." Telegram users themselves will be able to flag and report potentially false content. In the “Bear Market Screaming Therapy Group” on Telegram, members are only allowed to post voice notes of themselves screaming. Anything else will result in an instant ban from the group, which currently has about 75 members. Public channels are public to the internet, regardless of whether or not they are subscribed. A public channel is displayed in search results and has a short address (link). According to media reports, the privacy watchdog was considering “blacklisting” some online platforms that have repeatedly posted doxxing information, with sources saying most messages were shared on Telegram.
from us


Telegram NEXT CODE
FROM American