瀏覽代碼

Added gimbal

master
Pete Shadbolt 8 年之前
父節點
當前提交
6254467bce
共有 3 個檔案被更改,包括 12 行新增8 行删除
  1. +1
    -0
      static/index.html
  2. +9
    -7
      static/scripts/materials.js
  3. +2
    -1
      static/scripts/mouse.js

+ 1
- 0
static/index.html 查看文件

@@ -21,6 +21,7 @@

<body>
<img id="ball" src="img/ball.png" style=display:none;>
<img id="tip" src="img/tip.png" style=display:none;>
<div id=node_info class=hidden> nothing </div>
<div id=server_info class=hidden> </div>



+ 9
- 7
static/scripts/materials.js 查看文件

@@ -6,23 +6,25 @@ var curveProperties = {
};

materials.prepare = function() {
var sprite = new THREE.Texture(document.getElementById("ball"));
sprite.needsUpdate = true;
var ballSprite = new THREE.Texture(document.getElementById("ball"));
var tipSprite = new THREE.Texture(document.getElementById("tip"));
ballSprite.needsUpdate = true;
tipSprite.needsUpdate = true;
materials.edge = new THREE.LineBasicMaterial({
color: "gray",
transparent: false,
linewidth: 1
});
materials.point = new THREE.PointsMaterial({
size: 0.1,
map: sprite,
materials.tip = new THREE.PointsMaterial({
size: 0.4,
map: tipSprite,
alphaTest: 0.5,
transparent: true,
vertexColors: THREE.VertexColors
color: "red"
});
materials.qubit = new THREE.PointsMaterial({
size: 0.3,
map: sprite,
map: ballSprite,
alphaTest: 0.5,
transparent: true,
vertexColors: THREE.VertexColors


+ 2
- 1
static/scripts/mouse.js 查看文件

@@ -1,5 +1,6 @@
var mouse = {};
mouse.wasClick = true;
mouse.pressed = false;

mouse.raycaster = new THREE.Raycaster();

@@ -32,10 +33,10 @@ mouse.onDown = function(event) {
};

mouse.onUp = function(event) {
mouse.pressed = false;
if (!mouse.wasClick) {
return;
}
mouse.pressed = false;
if (event.ctrlKey) {
mouse.onCtrlClick();
} else if (event.shiftKey) {


Loading…
取消
儲存