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

Add 3D and map plotting tools #800

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft

Conversation

Timi007
Copy link
Contributor

@Timi007 Timi007 commented Mar 6, 2025

When merged this pull request will:

  • Add 3D and map plotting tools

This feature is meant to help the user measure distances and directions. The start and end positions can be either static or attached to an object, where the values are then updated dynamically. The user can toggle between different distance and azimuth formats using R and Tab ↹. More formatters can be defined in class zen_plotting_formatters. The color can be changed in the CBA settings. Plotting is possible in 3D or on the map.

grafik

TODO

  • Fix line connections of rectangular cuboid
  • Fix attaching plot to objects
  • Optimize drawing (do not draw if outside screen) The overhead of checking if the positions are in view is too high ~2x perf decrease
  • Add icons
  • Handle text rendering when attaching multiple plots to objects
  • Fix key handlers not always register input

@Timi007 Timi007 changed the title Add plotting tools Add 3D and map plotting tools Mar 6, 2025
@mharis001 mharis001 added the feature Adds a new feature label Mar 6, 2025
@mharis001 mharis001 added this to the 1.16.0 milestone Mar 6, 2025
Copy link
Member

@mharis001 mharis001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting functionality. Just some initial thoughts.

};
},
{},
[DIK_R, [false, false, false]] // Default: R
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These keybinds conflict with the same base game Zeus controls. I think a default behind some modifiers since this doesn't need to be so accessible would be good.

Comment on lines +3 to +18
class Meter {
formatter = QUOTE(format [ARR_2('%1 m',_value toFixed 1)]);
priority = 100;
};
class Feet {
formatter = QUOTE(format [ARR_2('%1 ft',(_value * 3.281) toFixed 1)]);
priority = 90;
};
class Yards {
formatter = QUOTE(format [ARR_2('%1 yd',(_value * 1.094) toFixed 1)]);
priority = 80;
};
class Mile {
formatter = QUOTE(format [ARR_2('%1 mi',(_value / 1609.344) toFixed 2)]);
priority = 70;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these could be made more complex. For example, I don't think the decimal point is needed after 100 m and for any moving object it just flickers. Essentially, increase precision for small values, decrease for large ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea


private _formatterString = getText (_entryConfig >> "formatter");
if (_formatterString isNotEqualTo "") then {
_formatterString = "params ['_value']; " + _formatterString;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary, just pass the value in _this and then, format ["%1 m", _this] for example.

@Timi007
Copy link
Contributor Author

Timi007 commented Mar 13, 2025

Thanks for the initial feedback! Can you maybe provide feedback on following question too?

  1. Currently, the max distance the lines and icons are rendered is hardcoded to 3km. Should this be a setting or maybe linked to the view distance?
  2. What measurements units should be present? As a user of the metric system, do we need feet, yards, and miles?
  3. For the line plot, I also want to add the time it takes to travel the distance depending on a speed. Should this speed be also a toggle like distance and azimuth formats? Or a setting? Or toggle + setting?
  4. When attaching a plot point to an object, the formatted texts overlap. In 3D, we can solve this using the text Y offset. On the map there is no parameter. Should only the text of the last plot be shown? Or do we just restrict attaching one plot to one object?

@mharis001
Copy link
Member

  1. I think just a reasonable max value is fine. For example, the visibility component uses a max of 5 km.
  2. You could combine it to "systems" instead of "units". So, metric: meters -> kilometers depending on distance, and imperial: feet -> yards -> miles. Not sure.
  3. Probably just a toggle.
  4. Even with multiple plots with offset text, it would be difficult to tell which one belongs to which plot. Again, not sure what the best UX here is.

Comment on lines +35 to +36
private _azimuthToStart = _endPos getDir _startPos;
private _azimuthToEnd = _startPos getDir _endPos;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be the relative direction?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the direction from start to end pos and end to start. Both _startPos and _endPos are PosASL. I don't understand the relative part in your question.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, when attached to objects the direction value being displayed did not seem intuitive. If that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check what you mean. It should show the same value as the unit just opening their compass.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it just comes to whether we want to know that the position is 90 degrees relative to the vehicle or just the difference in their bearings. The former what what I assumed the value was.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What purpose does relative bearing w.r.t. the attached unit have to the Zeus or any unit on the ground? I understand if you want the direction as a relative clock, but I have never given or received relative bearing. For artillery corrections, you also don't use relative directions.

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

Successfully merging this pull request may close these issues.

2 participants