-
Notifications
You must be signed in to change notification settings - Fork 51
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
Vector field options in 2D with single colored arrows above #278
base: master
Are you sure you want to change the base?
Conversation
…nction and in a single color.
@@ -844,7 +844,7 @@ thread_local double new_maxlen; | |||
void VisualizationSceneVector::DrawVector(double px, double py, double vx, | |||
double vy, double cval) | |||
{ | |||
double zc = 0.5*(bb.z[0]+bb.z[1]); | |||
double zc = (drawvector > 3)?(bb.z[1]):(0.5*(bb.z[0]+bb.z[1])); |
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.
Instead of additional options for v
, maybe it is better to add an input option lambda
(by default 0.5
) that can adjust the zc
value to (1-lambda)*bb.z[0]+ lambda*bb.z[1]
?
This is similar to how we handle e.g. level lines with F5 or rules positions with ~
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 do not know, I do not see much reason for an arbitrary position, I see only a reason for mid-plane and above. The second thing is that color. The other options (except the first one) use color coding, so the arrows are almost invisible (blended) when looking from above.
I changed the color of the arrows to gray as in 3D. Btw, mesh becomes also gray in 3D, which I do not know if it is a bug or feature 😅 and if we want to replicate that here. |
Sounds like a bug to me. 😄 |
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.
Looks good to me. @v-dobrev, do you approve?
This PR adds two options for visualization of vector fields. They are similar to the options 2 and 3, but the arrows are drawn above the function surface and in a single color (gray as the options 4 and 5 in 3D) instead of the placement on the mid-plane with colors encoding the values. The main purpose is visualization of 2D data, where the current options for visualization of vector fields draw arrows, which are partially hidden behind the surface and the arrows blend with the background when looking from top.
example 5:
option 4:
option 5: