Beispiel #1
0
        private void listClick(jQueryEvent e)
        {
            GeometryFunction f = e.Data as GeometryFunction;

            geometryIndex = functions.IndexOf(f);
            ShowGeometry();
        }
Beispiel #2
0
        private void ShowGeometry()
        {
            if (currentMesh != null)
            {
                scene.remove(currentMesh);
            }

            if (geometryIndex < 0)
            {
                geometryIndex = 0;
            }

            GeometryFunction f = functions[geometryIndex];

            THREE.Geometry geometry = f.function();

            THREE.Material mat = new THREE.MeshLambertMaterial();
            mat.color = new THREE.Color().setHex(Math.Random() * 0xffffff);


            currentMesh = new THREE.Mesh(geometry, mat);
            scene.add(currentMesh);

            dropDownButton.Text(f.name);
            Render();
        }