-
Notifications
You must be signed in to change notification settings - Fork 17
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
Update ThreeJS
#418
Update ThreeJS
#418
Changes from 9 commits
1873ff5
cf9fb51
52caaf9
1bd0c46
1354997
3161760
1b01646
f8cc8c3
a8ffb20
73cb1ef
d14a1c1
883b765
7c0c029
b1c311a
0357b48
54aca58
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,7 +218,8 @@ export class MainView extends React.Component<IProps, IStates> { | |
|
||
this._renderer = new THREE.WebGLRenderer({ | ||
alpha: true, | ||
antialias: true | ||
antialias: true, | ||
stencil: true | ||
}); | ||
// this._renderer.setPixelRatio(window.devicePixelRatio); | ||
this._renderer.setClearColor(0x000000, 0); | ||
|
@@ -685,6 +686,7 @@ export class MainView extends React.Component<IProps, IStates> { | |
wireframe: this.state.wireframe | ||
}); | ||
this._clippingPlaneMesh = new THREE.Mesh(planeGeom, planeMat); | ||
this._clippingPlaneMesh.visible = this._clipSettings.enabled; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this now that we set I'm fine letting this here though, it does sound sensible to not render the plane in anyway when the clipping is disabled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^^ Just a question, not a blocker There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok then let's keep it! I'm unsure what changed in ThreeJS that requires this change, but the code looks more sensible now so that's good I guess |
||
this._clippingPlaneMesh.onAfterRender = renderer => { | ||
renderer.clearStencil(); | ||
}; | ||
|
@@ -1255,11 +1257,17 @@ export class MainView extends React.Component<IProps, IStates> { | |
this._transformControls.enabled = true; | ||
this._transformControls.visible = true; | ||
this._clippingPlaneMeshControl.visible = this._clipSettings.showClipPlane; | ||
if (this._clippingPlaneMesh) { | ||
this._clippingPlaneMesh.visible = true; | ||
} | ||
} else { | ||
this._renderer.localClippingEnabled = false; | ||
this._transformControls.enabled = false; | ||
this._transformControls.visible = false; | ||
this._clippingPlaneMeshControl.visible = false; | ||
if (this._clippingPlaneMesh) { | ||
this._clippingPlaneMesh.visible = false; | ||
} | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Neat