Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

najlkin
Copy link
Contributor

@najlkin najlkin commented Mar 13, 2024

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:
image
option 5:
image

@najlkin najlkin self-assigned this Mar 13, 2024
@@ -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]));
Copy link
Member

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 ~

Copy link
Contributor Author

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.

@tzanio tzanio requested review from mlstowell and v-dobrev May 26, 2024 22:02
@tzanio tzanio added this to the glvis-4.3 milestone May 26, 2024
@najlkin
Copy link
Contributor Author

najlkin commented May 28, 2024

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.

@v-dobrev
Copy link
Member

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. 😄

@najlkin
Copy link
Contributor Author

najlkin commented May 29, 2024

@v-dobrev , fixed in #282 😉

@najlkin najlkin changed the title Vector field options with the arrows above and in a single color Vector field options in 2D with single colored arrows above May 30, 2024
Copy link
Member

@tzanio tzanio left a 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants