blob: 865cc09abea75b0b1afc8d44ed03872b9968d857 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// sun.js
import * as THREE from 'https://unpkg.com/three@0.160.0/build/three.module.js';
export function createSun() {
const sunRadius = 15;
const sunSegments = 64;
// Main sun mesh
const sunGeometry = new THREE.CircleGeometry(sunRadius, sunSegments);
const sunMaterial = new THREE.MeshBasicMaterial({
color: 0xf49922, // neon pink
transparent: false,
opacity: 1
});
const sun = new THREE.Mesh(sunGeometry, sunMaterial);
sun.position.set(0, 5, -51);
// Optional glow halo
const glowGeometry = new THREE.CircleGeometry(sunRadius * 1.4, sunSegments);
const glowMaterial = new THREE.MeshBasicMaterial({
color: 0xf49922,
transparent: true,
opacity: 0.1
});
const glow = new THREE.Mesh(glowGeometry, glowMaterial);
glow.position.copy(sun.position);
return { sun, glow };
}
|