|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"> |
| 6 | + <title>PlayCanvas Web Components - Primitive Shapes</title> |
| 7 | + <script type="importmap"> |
| 8 | + { |
| 9 | + "imports": { |
| 10 | + "playcanvas": "../node_modules/playcanvas/build/playcanvas.mjs" |
| 11 | + } |
| 12 | + } |
| 13 | + </script> |
| 14 | + <script type="module" src="../dist/pwc.mjs"></script> |
| 15 | + <link rel="stylesheet" href="css/example.css"> |
| 16 | + </head> |
| 17 | + <body> |
| 18 | + <pc-app> |
| 19 | + <!-- Assets --> |
| 20 | + <pc-asset id="camera-controls" src="../node_modules/playcanvas/scripts/esm/camera-controls.mjs" preload></pc-asset> |
| 21 | + <!-- Materials --> |
| 22 | + <pc-material id="crimson" diffuse="crimson"></pc-material> |
| 23 | + <pc-material id="mediumseagreen" diffuse="mediumseagreen"></pc-material> |
| 24 | + <pc-material id="steelblue" diffuse="steelblue"></pc-material> |
| 25 | + <pc-material id="hotpink" diffuse="hotpink"></pc-material> |
| 26 | + <pc-material id="goldenrod" diffuse="goldenrod"></pc-material> |
| 27 | + <pc-material id="lightgrey" diffuse="lightgrey"></pc-material> |
| 28 | + <!-- Scene --> |
| 29 | + <pc-scene> |
| 30 | + <!-- Camera --> |
| 31 | + <pc-entity name="camera" position="-3 2 -3.25"> |
| 32 | + <pc-camera></pc-camera> |
| 33 | + <pc-scripts> |
| 34 | + <pc-script name="cameraControls" attributes='{ |
| 35 | + "enableFly": false, |
| 36 | + "enablePan": false, |
| 37 | + "focusPoint": [0, 0.5, 0], |
| 38 | + "pitchRange": [-90, 0] |
| 39 | + }'></pc-script> |
| 40 | + </pc-scripts> |
| 41 | + </pc-entity> |
| 42 | + <!-- Key Light (Spot) --> |
| 43 | + <pc-entity name="keyLight" position="3 5 -3" rotation="-45 -45 0"> |
| 44 | + <pc-light type="spot" intensity="2" cast-shadows shadow-resolution="2048"></pc-light> |
| 45 | + </pc-entity> |
| 46 | + <!-- Fill Light (Omni) --> |
| 47 | + <pc-entity name="fillLight" position="-4 3 4"> |
| 48 | + <pc-light type="omni" intensity="0.5"></pc-light> |
| 49 | + </pc-entity> |
| 50 | + <!-- Rim Light (Spot) --> |
| 51 | + <pc-entity name="rimLight" position="-2 4 -4" rotation="-40 45 0"> |
| 52 | + <pc-light type="spot" intensity="1.5" cast-shadows shadow-resolution="2048"></pc-light> |
| 53 | + </pc-entity> |
| 54 | + <!-- Box--> |
| 55 | + <pc-entity name="box" position="1.5 0.5 0"> |
| 56 | + <pc-render type="box" material="crimson"></pc-render> |
| 57 | + </pc-entity> |
| 58 | + <!-- Capsule --> |
| 59 | + <pc-entity name="capsule" position="0.464 1 1.425"> |
| 60 | + <pc-render type="capsule" material="mediumseagreen"></pc-render> |
| 61 | + </pc-entity> |
| 62 | + <!-- Cylinder --> |
| 63 | + <pc-entity name="cylinder" position="-1.213 0.5 0.881"> |
| 64 | + <pc-render type="cylinder" material="hotpink"></pc-render> |
| 65 | + </pc-entity> |
| 66 | + <!-- Cone --> |
| 67 | + <pc-entity name="cone" position="-1.213 0.5 -0.881"> |
| 68 | + <pc-render type="cone" material="steelblue"></pc-render> |
| 69 | + </pc-entity> |
| 70 | + <!-- Sphere --> |
| 71 | + <pc-entity name="sphere" position="0.464 0.5 -1.425"> |
| 72 | + <pc-render type="sphere" material="goldenrod"></pc-render> |
| 73 | + </pc-entity> |
| 74 | + <!-- Plane --> |
| 75 | + <pc-entity name="plane" position="0 0 0" scale="7 1 7"> |
| 76 | + <pc-render type="plane" material="lightgrey"></pc-render> |
| 77 | + </pc-entity> |
| 78 | + </pc-scene> |
| 79 | + </pc-app> |
| 80 | + <script type="module" src="scripts/ui.mjs"></script> |
| 81 | + </body> |
| 82 | +</html> |
0 commit comments