-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Add rotation/translation to lines raycasting example #25042
Merged
mrdoob
merged 6 commits into
mrdoob:dev
from
bergden-resonai:add-rotation-to-line2-example
Dec 7, 2022
Merged
Add rotation/translation to lines raycasting example #25042
mrdoob
merged 6 commits into
mrdoob:dev
from
bergden-resonai:add-rotation-to-line2-example
Dec 7, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rix test more common
bergden-resonai
commented
Nov 30, 2022
Comment on lines
+57
to
+95
const raycaster = new THREE.Raycaster(); | ||
|
||
raycaster.params.Line2 = {}; | ||
raycaster.params.Line2.threshold = 0; | ||
|
||
const matLine = new LineMaterial( { | ||
|
||
color: 0xffffff, | ||
linewidth: 1, // in world units with size attenuation, pixels otherwise | ||
worldUnits: true, | ||
vertexColors: true, | ||
|
||
//resolution: // to be set by renderer, eventually | ||
alphaToCoverage: true, | ||
|
||
} ); | ||
|
||
const matThresholdLine = new LineMaterial( { | ||
|
||
color: 0xffffff, | ||
linewidth: matLine.linewidth, // in world units with size attenuation, pixels otherwise | ||
worldUnits: true, | ||
// vertexColors: true, | ||
transparent: true, | ||
opacity: 0.2, | ||
depthTest: false, | ||
visible: false, | ||
//resolution: // to be set by renderer, eventually | ||
|
||
} ); | ||
|
||
const params = { | ||
|
||
'line type': 0, | ||
'world units': matLine.worldUnits, | ||
'visualize threshold': matThresholdLine.visible, | ||
'width': matLine.linewidth, | ||
'alphaToCoverage': matLine.alphaToCoverage, | ||
'threshold': raycaster.params.Line2.threshold, |
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.
Same code, just moved to the file's scope
Mugen87
approved these changes
Nov 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue: #24405
Description
@MixMasterMitch fixed the bug and suggested an easy modification to the example to show the bug
I think the example is cooler* this way, and now it'll be easier to catch similar bugs
Had to move some things around to make things available on the right(?) scopes
The animation code is borrowed from the clipping / stencil example
This contribution is funded by Resonai and @MixMasterMitch
*Moral justification for this pull request(?):