mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:58:07 +02:00
only can draw on whiteboard
This commit is contained in:
parent
f0a1335957
commit
8fcc071026
1 changed files with 21 additions and 12 deletions
|
@ -33,24 +33,32 @@ var colors = [
|
||||||
hexToRgb("#993369"),
|
hexToRgb("#993369"),
|
||||||
hexToRgb("#000000")
|
hexToRgb("#000000")
|
||||||
];
|
];
|
||||||
|
|
||||||
var whiteboard = Entities.addEntity({
|
var whiteboard = Entities.addEntity({
|
||||||
type: "Model",
|
type: "Model",
|
||||||
modelURL: modelURL,
|
modelURL: modelURL,
|
||||||
name: "whiteboard",
|
name: "whiteboard base",
|
||||||
position: center,
|
position: center,
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
|
});
|
||||||
|
|
||||||
|
var surfaceCenter = Vec3.sum(center, Vec3.multiply(-0.1, Quat.getFront(rotation)));
|
||||||
|
surfaceCenter.y += 0.55;
|
||||||
|
var drawingSurface = Entities.addEntity({
|
||||||
|
type: "Box",
|
||||||
|
color: {red: 255, green: 255, blue: 255},
|
||||||
|
name: "whiteboard surface",
|
||||||
|
position: surfaceCenter,
|
||||||
|
dimensions: {x: 1.8, y: 1.4, z: 0.01},
|
||||||
script: scriptURL,
|
script: scriptURL,
|
||||||
color: {
|
rotation: rotation,
|
||||||
red: 255,
|
userData: JSON.stringify({
|
||||||
green: 255,
|
|
||||||
blue: 255
|
|
||||||
},
|
|
||||||
userData: JSON.stringify({
|
|
||||||
color: {
|
color: {
|
||||||
currentColor: colors[0]
|
currentColor: colors[0]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
|
||||||
|
})
|
||||||
|
|
||||||
Script.setTimeout(function() {
|
Script.setTimeout(function() {
|
||||||
whiteboardDimensions = Entities.getEntityProperties(whiteboard, "naturalDimensions").naturalDimensions;
|
whiteboardDimensions = Entities.getEntityProperties(whiteboard, "naturalDimensions").naturalDimensions;
|
||||||
|
@ -80,11 +88,11 @@ function setUp() {
|
||||||
dimensions: colorIndicatorDimensions,
|
dimensions: colorIndicatorDimensions,
|
||||||
script: scriptURL,
|
script: scriptURL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
whiteboard: whiteboard
|
whiteboard: drawingSurface
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
Entities.editEntity(whiteboard, {
|
Entities.editEntity(drawingSurface, {
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
color: {
|
color: {
|
||||||
currentColor: colors[0]
|
currentColor: colors[0]
|
||||||
|
@ -121,7 +129,7 @@ function setUp() {
|
||||||
color: colors[i],
|
color: colors[i],
|
||||||
script: scriptURL,
|
script: scriptURL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
whiteboard: whiteboard,
|
whiteboard: drawingSurface,
|
||||||
colorIndicator: colorIndicatorBox
|
colorIndicator: colorIndicatorBox
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -161,7 +169,7 @@ function setUp() {
|
||||||
text: "ERASE BOARD",
|
text: "ERASE BOARD",
|
||||||
lineHeight: 0.07,
|
lineHeight: 0.07,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
whiteboard: whiteboard
|
whiteboard: drawingSurface
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -171,6 +179,7 @@ function setUp() {
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
Entities.deleteEntity(whiteboard);
|
Entities.deleteEntity(whiteboard);
|
||||||
|
Entities.deleteEntity(drawingSurface);
|
||||||
Entities.deleteEntity(eraseAllText);
|
Entities.deleteEntity(eraseAllText);
|
||||||
Entities.deleteEntity(colorIndicatorBox);
|
Entities.deleteEntity(colorIndicatorBox);
|
||||||
colorBoxes.forEach(function(colorBox) {
|
colorBoxes.forEach(function(colorBox) {
|
||||||
|
|
Loading…
Reference in a new issue