Space Engineers

Space Engineers

48 个评价
Camera Heightmap Visualization Script (camera to lcd)
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
358.096 KB
2022 年 1 月 15 日 下午 6:57
2022 年 2 月 26 日 下午 4:15
7 项改动说明 ( 查看 )

订阅以下载
Camera Heightmap Visualization Script (camera to lcd)

描述
Description:
This is a script that I have created as a demonstration of the method in which cameras in SE can be used to display basically what they see to lcd panels via raycasts to get distances to generate a visual representation of the data as a heightmap. Essentially this demonstrates the most optimal method of a "camera to lcd" script that one could create (with only one camera), as far as I know.
Using the font mod specified below, you can adjust custom furthest and closest RGB colors, and enjoy an pleasantly smooth gradient from far to near. Without the mod this script works just fine but with a maximum depth of 8 colors.

You can download DraygoKorvan's font mod here: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2174915662

The three four eight (current) customisable values in this script are:

RESOLUTION (an integer defining the amount of pixels the render will be)
TARGET_DIST (an integer of the chosen maximum distance (I presume in meters) of the raycasts)
line_by_line (*Deprecated feature* the bool for deciding which method of displaying you would wish to use).
insta_mode (the bool for enabling Insta-Mode, details below)
font_mod_active (a bool for enabling the usage of DraygoKorvan's Mono Color font mod)
_farRGB (the Vector3 containing the R, G, and B (in that order) values for the furthest color)
_nearRGB (another Vector3 which is the same as farRGB but is for specifying the nearest color of the gradient)
_nullColor (Vector3 color for when a raycast hits nothing)

Potential future updates:

Instant picture mode (a mode where the camera is allowed to accumulate the sufficient "raycast credits" required to do an entire render instantly) <-- Done
Multi-camera support? (using multiple cameras to exponentially decrease render times, though offsetting will have to, uh, be accounted for, so that'll not be any time soon) <- Done
More Gradients? (Could be nice I guess) <-- Done

Instructions:

1. Subscribe to the script via the button above (and click like aye?)
2. Create a group of any sort of SQUARE (output is always square) lcd panels called "mapdisplays" (without quotation marks) of the panels in which you would like to display the output on. All settings are automatic; recompile script to take into account changes.
3. Build at least one camera in an (optionally) equilateral square pattern (as seen in one of the images).
4. Group those cameras into a group called "mapcams" (without quotation marks), and name the center-most camera "mapcam_center" (without quotation marks).
5. Now build a programmable block, access it, and load in the script.
6. Change the described settings to what you want.
7. When saving the script you will see 2 to 4 warnings depending on what you set for some settings, IGNORE them and click ok.
8. Recompile and it'll begin scanning with the provided settings!

Insta-Mode (New Feature)

How to use:
1.) Set bool "insta_mode" to be true
2.) Set bool "line_by_line" to be false
3.) Click "check code", "ok", and then "compile"
4.) Watch the raycast credits counter and the text underneath to determine if the required amount of raycast credits have been accumulated.
5.) Wait until it says it's ready
6.) Take a pic by running with the argument "pic" (without quotation marks), this can be done with a button, toolbar action, or manually.
7.) Wait up to like 3 seconds and observe!
8.) Click the "like" button on this workshop page?

More pictures can be taken simply by waiting for the required raycast credits to be accumulated and then running the argument again.

Notes

Feel free to look inside and use this script for anything really, asides from re-uploading unmodified versions of my original code.
More scripts of random stuff coming soon.
热门讨论 查看全部(1)
4
2023 年 5 月 6 日 下午 11:34
If you notice a bug or somethin', you may post it here.
Zachnad0.64bitOS
38 条留言
megadeathclaw 10 月 11 日 下午 2:09 
and instantaneously maybe make it able to have live video feed on lcds
megadeathclaw 10 月 11 日 下午 2:08 
can you make a version of this script that uses Whip's Image Converter so it can get display a image in better quality
Zachnad0.64bitOS  [作者] 2024 年 9 月 8 日 下午 1:28 
@Into Yes unfortunately, since each camera has to "charge up" enough before casting. Doubling the number of cameras you have will halve the "charge" cost for each cast. Note that the total "charge" cost is: RESOLUTION * TARGET_DIST / (# of cameras).
Currently, only mods can remove the need for "charging".
Into 2024 年 9 月 7 日 下午 2:14 
It takes quite a while (minutes) to cast a single picture, is it normal?
Personne 2024 年 4 月 18 日 下午 12:58 
very intresting proof of concept, I don't see an immediate military application but it stays an important breaktrough for futures ideas and scripts (forgive my bad english):steamthumbsup:
Zachnad0.64bitOS  [作者] 2024 年 2 月 6 日 下午 6:43 
kinngrimm 2024 年 1 月 29 日 下午 5:26 
looking forward to it
Zachnad0.64bitOS  [作者] 2024 年 1 月 29 日 下午 3:18 
@kinngrimm It appears that the only info able to be retrieved via the ore detector's scripting interface is the distance to only the nearest voxel chunk of ore. Not even the type of ore can be determined, which is actually quite disappointing. There is, however, this mod that seems to allow camera-like raycasting of ores, which might actually make this possible. As the original mod has been deprecated, the derived mod I linked claims it can scan at 100km without charging, so that could be an excellent solution. Browsing the workshop brings up nothing like this exactly, so I'll test this out as soon as possible.
Zachnad0.64bitOS  [作者] 2024 年 1 月 29 日 下午 3:17 
@rob That exception is most likely due to a missing block in setup. If you are certain you have all of the blocks correctly named, and the issue still persists after re-setting the script on the programmable block, then post a comment into the bug discussion .
Robin <3 2024 年 1 月 28 日 下午 2:00 
it just says caught exception on execution of the script object reference not set to an instance to an object ples help