Skip to content

Commit

Permalink
Update threeHelper.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kirandeol committed May 27, 2024
1 parent ae21124 commit 2f41d69
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions threeHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ export function renderParallelCoords(renderer, sceneInfo) {

// camera.aspect = width / height;
// camera.updateProjectionMatrix();

const positiveYUpBottom = renderer.domElement.clientHeight - bottom;

let axes = document.getElementById("axes");
axes.style.left = left;
axes.style.maxWidth = width;
axes.style.width = width;


const positiveYUpBottom = renderer.domElement.clientHeight - bottom;
renderer.setScissor(left, positiveYUpBottom, width, height);
renderer.setViewport(left, positiveYUpBottom, width, height);
renderer.render(sceneInfo.scene, sceneInfo.camera);

renderer.render(sceneInfo.scene, sceneInfo.camera);
}

export function makeScene(elem) {
Expand All @@ -26,16 +32,17 @@ export function makeScene(elem) {

elem.style.width = width
elem.style.height = height

const camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 ); // wants a 2x2 plane


const camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 ); // wants a 2x2 plane
camera.position.set(0, 0, 1);
// camera.lookAt(0, 0, 0)

// used to debug camera, could replace this with a scene background
const geometry = new THREE.PlaneGeometry( 2, 2 );
const material = new THREE.MeshBasicMaterial( {color: 0xaaaaaa, transparent: true, opacity: 0.1 } )// , side: THREE.DoubleSide} );
const backing = new THREE.Mesh(geometry, material);
scene.add(backing)
//scene.add(backing)

return {scene, camera, elem, backing};
}
Expand All @@ -62,4 +69,4 @@ export function makeScene(elem) {
sceneInfo.scene.add(line);
return sceneInfo
} */
} */

0 comments on commit 2f41d69

Please sign in to comment.