-
Notifications
You must be signed in to change notification settings - Fork 1
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
Scale vertexIntensity values by max value encountered #5
Conversation
... to be on-par with gl-cone3d algo.
@@ -34,7 +39,7 @@ var streamToTube = function(stream, maxDivergence, minDistance) { | |||
if (maxDivergence === 0) { | |||
r = minDistance * 0.05; | |||
} | |||
currentIntensity = vec3.length(fwd); | |||
currentIntensity = vec3.length(fwd) / maxNorm; |
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.
I was going to suggest dealing with division by zero here, but on second thought, it's not necessary. With zero field, you'd end up with a division by zero. But with a zero field you wouldn't have a stream anyway, so you shouldn't encounter this line with zero maxNorm.
streamtube.js
Outdated
var maxNorm = 0; | ||
|
||
for (var i = 0; i < points.length; i++) { | ||
maxNorm = Math.max(vec3.length(velocities[i]), maxNorm); |
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.
This is a per-stream maxNorm. You probably want to compute a maxNorm of all the streams instead and pass it to streamToTube.
Thanks, this is good to have. If need be, we could also add something like an |
Thanks for fixing this up @kig 🎉
We could, but we don't need to add this to var meshData = tube2mesh({/* */})
meshData.vertexIntensityBounds = [/**/, /**/]
createTubeMesh(meshData) |
... with the help of gl-vis/gl-streamtube3d#5
to bring gl-streamtube3d to par with gl-cone3d and make the plotly.js wrapper a lot less painful to write.
I hope @kig won't mind.