Files

43 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# hollow_purple.js — main() (satır 9)
[← hollow_purple.js](index.md) · [← Master](../../wiki.md)
Parça 3/15 · [önceki](main-2.md) · [sonraki](main-4.md)
```javascript
    function drawSphere(ox, oy, oz, radius, morph, exp, spin, blockYaw, blockPitch) {
        var bands = 5;
        for (var b = 1; b < bands; b++) {
            var latA = (b / bands) * Math.PI;
            var yy = Math.cos(latA) * radius;
            var rr = Math.sin(latA) * radius;
            var pts = Math.max(4, Math.round(rr * 2.5));
            for (var p = 0; p < pts; p++) {
                var lonA = (p / pts) * Math.PI * 2 + spin;
                world.displayMorph(morph, exp,
                    ox + Math.cos(lonA) * rr, oy + yy, oz + Math.sin(lonA) * rr,
                    blockYaw, blockPitch, 96, null);
            }
        }
        // kutuplar
        world.displayMorph(morph, exp, ox, oy + radius, oz, blockYaw, blockPitch, 96, null);
        world.displayMorph(morph, exp, ox, oy - radius, oz, blockYaw, blockPitch, 96, null);
    }
    // ---------- Yardımcı: look'a dik blok halkası ----------
    function ringMorphs(ox, oy, oz, radius, morph, exp, phase, pts) {
        if (!pts) pts = 14;
        for (var i = 0; i < pts; i++) {
            var a  = (i / pts) * Math.PI * 2 + phase;
            var ca = Math.cos(a), sa = Math.sin(a);
            world.displayMorph(morph, exp,
                ox + (rightX * ca + upX * sa) * radius,
                oy + (upY * sa) * radius,
                oz + (rightZ * ca + upZ * sa) * radius,
                a * 57.3, 0, 96, null);
        }
    }
    // ---------- Yardımcı: tek blok enkaz uçuşu ----------
```