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