Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump three js from 0.94 to 0.125.1 #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"module": "es/index.js",
"jsnext:main": "es/index.js",
"scripts": {
"start": "webpack-dev-server --inline --config demo/webpack.config.js --port 9000 --mode development",
"start": "webpack-dev-server --inline --config demo/webpack.config.js --port 9001 --mode development",
"build-demo": "webpack --config demo/webpack.config.js --mode production",
"build-commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
"build-es": "cross-env BABEL_ENV=es babel src --copy-files --out-dir es",
Expand Down Expand Up @@ -99,14 +99,9 @@
"react-dom": "16.8.5",
"rimraf": "2.6.3",
"style-loader": "0.23.1",
"three": "0.94.0",
"three": "0.125.1",
"webpack": "4.29.6",
"webpack-cli": "3.3.0",
"webpack-dev-server": "3.7.1"
},
"peerDependencies": {
"react": "16.x",
"react-dom": "16.x",
"three": "0.94.x"
}
}
19 changes: 0 additions & 19 deletions src/catalog/factories/area-factory-3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,6 @@ const applyTexture = (material, texture, length, height) => {
const assignUVs = (geometry) => {
geometry.computeBoundingBox();

let {min, max} = geometry.boundingBox;

let offset = new Vector2(0 - min.x, 0 - min.y);
let range = new Vector2(max.x - min.x, max.y - min.y);

geometry.faceVertexUvs[0] = geometry.faces.map((face) => {

let v1 = geometry.vertices[face.a];
let v2 = geometry.vertices[face.b];
let v3 = geometry.vertices[face.c];

return [
new Vector2((v1.x + offset.x) / range.x, (v1.y + offset.y) / range.y),
new Vector2((v2.x + offset.x) / range.x, (v2.y + offset.y) / range.y),
new Vector2((v3.x + offset.x) / range.x, (v3.y + offset.y) / range.y)
];

});

geometry.uvsNeedUpdate = true;
};

Expand Down
7 changes: 4 additions & 3 deletions src/components/viewer3d/grids/grid-horizontal-streak.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export default function (width, height, grid, font) {

for (let i = 0; i <= height; i += step) {

let geometry = new Three.Geometry();
geometry.vertices.push(new Three.Vector3(0, 0, -i));
geometry.vertices.push(new Three.Vector3(width, 0, -i));
let vertices = [];
vertices.push(new Three.Vector3(0, 0, -i));
vertices.push(new Three.Vector3(width, 0, -i));
let geometry = new Three.BufferGeometry().setFromPoints( vertices );
let color = colors.get(counter % colors.size);
let material = new Three.LineBasicMaterial({ color });

Expand Down
7 changes: 4 additions & 3 deletions src/components/viewer3d/grids/grid-vertical-streak.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ export default function (width, height, grid, font) {

for (let i = 0; i <= width; i += step) {

let geometry = new Three.Geometry();
geometry.vertices.push(new Three.Vector3(i, 0, 0));
geometry.vertices.push(new Three.Vector3(i, 0, -height));
let vertices = [];
vertices.push(new Three.Vector3(i, 0, 0));
vertices.push(new Three.Vector3(i, 0, -height));
let geometry = new Three.BufferGeometry().setFromPoints( vertices );
let color = colors.get(counter % colors.size);
let material = new Three.LineBasicMaterial({ color });

Expand Down
28 changes: 15 additions & 13 deletions src/components/viewer3d/viewer3d-first-person.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,27 +135,29 @@ export default class Viewer3DFirstPerson extends React.Component {
pointer.name = 'pointer';

let pointerMaterial = new Three.MeshBasicMaterial({depthTest: false, depthWrite: false, color: SharedStyle.COLORS.black});
let pointerGeometry1 = new Three.Geometry();
pointerGeometry1.vertices.push(new Three.Vector3(-10, 0, 0));
pointerGeometry1.vertices.push(new Three.Vector3(10, 0, 0));

let vertices = [];
vertices.push(new Three.Vector3(-10, 0, 0));
vertices.push(new Three.Vector3(10, 0, 0));
let pointerGeometry1 = new Three.BufferGeometry().setFromPoints( vertices );
let linePointer1 = new Three.Line(pointerGeometry1, pointerMaterial);
linePointer1.position.z -= 100;

let pointerGeometry2 = new Three.Geometry();
pointerGeometry2.vertices.push(new Three.Vector3(0, 10, 0));
pointerGeometry2.vertices.push(new Three.Vector3(0, -10, 0));
let vertices2 = [];
vertices2.push(new Three.Vector3(0, 10, 0));
vertices2.push(new Three.Vector3(0, -10, 0));
let pointerGeometry2 = new Three.BufferGeometry().setFromPoints( vertices2 );

let linePointer2 = new Three.Line(pointerGeometry2, pointerMaterial);
linePointer2.renderDepth = 1e20;
linePointer2.position.z -= 100;

let pointerGeometry3 = new Three.Geometry();
pointerGeometry3.vertices.push(new Three.Vector3(-1, 1, 0));
pointerGeometry3.vertices.push(new Three.Vector3(1, 1, 0));
pointerGeometry3.vertices.push(new Three.Vector3(1, -1, 0));
pointerGeometry3.vertices.push(new Three.Vector3(-1, -1, 0));
pointerGeometry3.vertices.push(new Three.Vector3(-1, 1, 0));
let vertices3 = [];
vertices3.push(new Three.Vector3(-1, 1, 0));
vertices3.push(new Three.Vector3(1, 1, 0));
vertices3.push(new Three.Vector3(1, -1, 0));
vertices3.push(new Three.Vector3(-1, -1, 0));
vertices3.push(new Three.Vector3(-1, 1, 0));
let pointerGeometry3 = new Three.BufferGeometry().setFromPoints( vertices3 );

let linePointer3 = new Three.Line(pointerGeometry3, pointerMaterial);
linePointer3.position.z -= 100;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/threeCSG.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default class ThreeBSP {
toGeometry() {
var i, j,
matrix = new THREE.Matrix4().getInverse(this.matrix),
geometry = new THREE.Geometry(),
geometry = new THREE.BufferGeometry(),
polygons = this.tree.allPolygons(),
polygon_count = polygons.length,
polygon, polygon_vertice_count,
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


Expand Down