0.0.156 • Published 10 months ago

@anov/3d v0.0.156

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

anov-3d

anov 3d 核心包

示例网站 (notes: 暂时需科学上网)

usage

install

pnpm add @anov/3d

init a base scene 「wip」

import { Mesh, Scene, BoxGeometry, MeshBasicMaterial } from '@anov/3d'

const scene = new Scene({
  orbitControls: true,
})

const geometry = new BoxGeometry(2, 2, 2)
const material = new MeshBasicMaterial({ color: 0x00FF00 })
const box = new Mesh(geometry, material)

box.addNatureEventListener('pointermove', (object3D) => {
  (object3D.material as any).color.set(0xFF0000)
})
box.addNatureEventListener('pointerleave', (object3D) => {
  (object3D.material as any).color.set('#ccc')
})

scene.add(box)

scene.render(document.querySelector('#app')!)
scene.startFrameAnimate()

base object3d motion 「wip」

import { Mesh, Scene, utils, AxesHelper, BoxGeometry, GridHelper, MeshBasicMaterial } from '@anov/3d'

const scene = new Scene({
  orbitControls: true,
})

const geometry = new BoxGeometry(2, 2, 2)
const material = new MeshBasicMaterial({ color: 0x00FF00 })
const box = new Mesh(geometry, material)

const geometry2 = new BoxGeometry(2, 2, 2)
const materia2 = new MeshBasicMaterial({ color: '#ccc' })
const box2 = new Mesh(geometry2, materia2)

box.position.set(0, 0, 0)
box2.position.set(10, 30, -30)

scene.add(box)
scene.add(box2)

utils.moveWithRound(box2, 0.2, 100000)

scene.render(document.querySelector('#app')!)
scene.startFrameAnimate()

umd usage

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="./source/base.css" />
    </style>
</head>

<body>
    <div id="describe">基本场景,鼠标点击移入移出点击交互</div>
    <div id="my-sandbox"></div>
    <script>
        javascript: (function () {
            var script = document.createElement('script');
            script.onload = function () {
                var stats = new Stats();
                document.body.appendChild(stats.dom);
                requestAnimationFrame(function loop() {
                    stats.update();
                    requestAnimationFrame(loop)
                });
            };
            script.src = 'https://mrdoob.github.io/stats.js/build/stats.min.js';
            document.head.appendChild(script);
        })()
    </script>
    // umd包 
    <script src="https://cdn.jsdelivr.net/npm/@anov/3d@0.0.1-alpha.5/lib/3d.min.js"></script>

    <script script type="module">
        const scene = new ANOV.Scene({
            orbitControls: true,
        })

        const geometry = new ANOV.BoxGeometry(2, 2, 2)
        const material = new ANOV.MeshBasicMaterial()
        const box = new ANOV.Mesh(geometry, material)

        const geometry2 = new ANOV.BoxGeometry(2, 2, 2)
        const material2 = new ANOV.MeshBasicMaterial()
        const box2 = new ANOV.Mesh(geometry2, material2)

        box.addNatureEventListener('pointermove', (object3D) => {
            object3D.material.color.set(0xFF0000)
        })
        box.addNatureEventListener('pointerleave', (object3D) => {
            object3D.material.color.set('#ccc')
        })

        box2.addNatureEventListener('click', (object3D) => {
            object3D.material.color.set(0xFF0000)
        })
        box2.addNatureEventListener('pointerleave', (object3D) => {
            object3D.material.color.set('#fff')
        })

        box2.position.set(5, 0, 0)
        scene.add(box)
        scene.add(box2)

        scene.scene.background = new ANOV.Color('#345')
        scene.render(document.querySelector('#my-sandbox'))
        scene.startFrameAnimate()
    </script>

</body>

</html>
0.0.153

11 months ago

0.0.156

10 months ago

0.0.142

11 months ago

0.0.141

11 months ago

0.0.140

11 months ago

0.0.84

1 year ago

0.0.85

1 year ago

0.0.86

1 year ago

0.0.87

1 year ago

0.0.88

1 year ago

0.0.89

1 year ago

0.0.80

1 year ago

0.0.81

1 year ago

0.0.82

1 year ago

0.0.83

1 year ago

0.0.73

1 year ago

0.0.74

1 year ago

0.0.75

1 year ago

0.0.76

1 year ago

0.0.77

1 year ago

0.0.78

1 year ago

0.0.79

1 year ago

0.0.70

1 year ago

0.0.71

1 year ago

0.0.72

1 year ago

0.0.62

1 year ago

0.0.63

1 year ago

0.0.64

1 year ago

0.0.65

1 year ago

0.0.66

1 year ago

0.0.67

1 year ago

0.0.68

1 year ago

0.0.69

1 year ago

0.0.60

1 year ago

0.0.61

1 year ago

0.0.59

1 year ago

0.0.106

1 year ago

0.0.51

1 year ago

0.0.105

1 year ago

0.0.52

1 year ago

0.0.104

1 year ago

0.0.53

1 year ago

0.0.103

1 year ago

0.0.54

1 year ago

0.0.55

1 year ago

0.0.109

1 year ago

0.0.56

1 year ago

0.0.108

1 year ago

0.0.57

1 year ago

0.0.107

1 year ago

0.0.58

1 year ago

0.0.102

1 year ago

0.0.101

1 year ago

0.0.100

1 year ago

0.0.50

1 year ago

0.0.48

1 year ago

0.0.49

1 year ago

0.0.117

1 year ago

0.0.116

1 year ago

0.0.115

1 year ago

0.0.114

1 year ago

0.0.44

1 year ago

0.0.45

1 year ago

0.0.119

1 year ago

0.0.46

1 year ago

0.0.118

1 year ago

0.0.47

1 year ago

0.0.112

1 year ago

0.0.111

1 year ago

0.0.110

1 year ago

0.0.128

1 year ago

0.0.127

1 year ago

0.0.126

1 year ago

0.0.125

1 year ago

0.0.129

1 year ago

0.0.120

1 year ago

0.0.124

1 year ago

0.0.123

1 year ago

0.0.122

1 year ago

0.0.121

1 year ago

0.0.139

11 months ago

0.0.137

11 months ago

0.0.136

12 months ago

0.0.131

1 year ago

0.0.130

1 year ago

0.0.134

1 year ago

0.0.133

1 year ago

0.0.132

1 year ago

0.0.95

1 year ago

0.0.96

1 year ago

0.0.97

1 year ago

0.0.98

1 year ago

0.0.99

1 year ago

0.0.90

1 year ago

0.0.91

1 year ago

0.0.92

1 year ago

0.0.93

1 year ago

0.0.94

1 year ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.39

1 year ago

0.0.38

1 year ago

0.0.30

1 year ago

0.0.25-alpha0

1 year ago

0.0.25-alpha1

1 year ago

0.0.28

1 year ago

0.0.24

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.20

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.4-alpha35

1 year ago

0.0.4-alpha36

1 year ago

0.0.4-alpha37

1 year ago

0.0.4-alpha31

1 year ago

0.0.4-alpha32

1 year ago

0.0.4-alpha33

1 year ago

0.0.4-alpha34

1 year ago

0.0.4-alpha29

1 year ago

0.0.4-alpha28

1 year ago

0.0.4-alpha30

1 year ago

0.0.4-alpha27

1 year ago

0.0.4-alpha25

1 year ago

0.0.4-alpha26

1 year ago

0.0.4-alpha23

1 year ago

0.0.4-alpha24

1 year ago

0.0.4-alpha21

1 year ago

0.0.4-alpha22

1 year ago

0.0.4-alpha20

1 year ago

0.0.4-alpha18

1 year ago

0.0.4-alpha19

1 year ago

0.0.4-alpha17

2 years ago

0.0.4-alpha16

2 years ago

0.0.4-alpha15

2 years ago

0.0.4-alpha12

2 years ago

0.0.4-alpha13

2 years ago

0.0.4-alpha14

2 years ago

0.0.4-alpha.1

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1-alpha.11

2 years ago

0.0.1-alpha.10

2 years ago

0.0.1-alpha.9

2 years ago

0.0.1-alpha.8

2 years ago

0.0.1-alpha.7

2 years ago

0.0.1-alpha.6

2 years ago

0.0.1-alpha.5

2 years ago

0.0.1-alpha.4

2 years ago

0.0.1-alpha.3

2 years ago

0.0.1-alpha.2

2 years ago

0.0.1-alpha.1

2 years ago

0.0.1-alpha.0

2 years ago

0.0.1

2 years ago