3d grid + cleaner 2D 3D Mode
This commit is contained in:
@@ -29,7 +29,7 @@ class DashboardsController extends EICController {
|
||||
},
|
||||
{
|
||||
models: models,
|
||||
camName: 'persp1'
|
||||
mode: '3D'
|
||||
}
|
||||
)
|
||||
this.loadWindow(
|
||||
@@ -47,7 +47,7 @@ class DashboardsController extends EICController {
|
||||
},
|
||||
{
|
||||
models: models,
|
||||
camName: 'cam2Dtop'
|
||||
mode: '2D'
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
+16
-11
@@ -12,6 +12,10 @@ export class Threetobus{
|
||||
// Scene
|
||||
this.scene = new THREE.Scene()
|
||||
|
||||
this.grid = new THREE.GridHelper(20, 20, 0x444444, 0x888888)
|
||||
//this.grid.rotation.x = Math.PI / 2 // Default is on the XZ plane → rotate to XY
|
||||
this.scene.add(this.grid)
|
||||
|
||||
// Cameras
|
||||
this.cameras.persp1 = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000)
|
||||
this.cameras.persp1.position.set(3, 3, 5)
|
||||
@@ -41,17 +45,18 @@ export class Threetobus{
|
||||
|
||||
}
|
||||
|
||||
startRendering(){
|
||||
//controls
|
||||
this.controls = new OrbitControls(this.camera, this.renderer.domElement)
|
||||
//this.renderer.render(this.scene, this.camera)
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
this.camera.aspect = window.innerWidth / window.innerHeight
|
||||
this.camera.updateProjectionMatrix()
|
||||
renderer.setSize(window.innerWidth, window.innerHeight)
|
||||
})
|
||||
|
||||
startRendering(mode){
|
||||
if(mode=='2D'){
|
||||
this.changeCamera('cam2Dtop')
|
||||
} else if(mode=='3D') {
|
||||
this.changeCamera('persp1')
|
||||
this.controls = new OrbitControls(this.camera, this.renderer.domElement)
|
||||
window.addEventListener('resize', () => {
|
||||
this.camera.aspect = window.innerWidth / window.innerHeight
|
||||
this.camera.updateProjectionMatrix()
|
||||
renderer.setSize(window.innerWidth, window.innerHeight)
|
||||
})
|
||||
}
|
||||
this.render()
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ class MainDashboardView extends EICDomContent {
|
||||
constructor() {
|
||||
super()
|
||||
Object.assign(this, app.helpers.activeAttributes)
|
||||
//this.tileMarkup = app.Assets.Store.html['/app/assets/html/mailing/tile.html']
|
||||
}
|
||||
|
||||
DOMContentFocused(options) {
|
||||
@@ -55,8 +56,7 @@ class MainDashboardView extends EICDomContent {
|
||||
|
||||
this.ttb = new app.LoadedModules.Threetobus(this.outputs.paper43)
|
||||
this.ttb.initScene()
|
||||
this.ttb.changeCamera(options.camName)
|
||||
this.ttb.startRendering()
|
||||
this.ttb.startRendering(options.mode)
|
||||
|
||||
const m1 = this.ttb.buildFromJSON(this.agentTypes.molecule1)
|
||||
m1.name = 'toto'
|
||||
|
||||
Reference in New Issue
Block a user