Stormworks: Build and Rescue

Stormworks: Build and Rescue

3d Projection Demo (Augmented Reality)
91 Comments
Basharbobo1 6 Nov, 2024 @ 6:49am 
I can code in lua somewhat, but to be honest with u am incredibly lazy, so that's why I asked you instead of looking through the github myself. Thanks for the answer tho will attempt this soon hopefully
Jumper  [author] 1 Nov, 2024 @ 7:25am 
[2/2]
By the way you are asking, then I'm assuming Lua isn't your strong front and you haven't looked through the github, or not familiar with how a virtual camera works etc. so it's fair to be uncertain.

So I assume it wouldn't be straight forward for you, but at least look though the code and readme on the github and judge for yourself. You would just need to understand the Input/Output for the cameraTransform.lua and understand the Render.lua file to project 3d points to the screen.
There's an in game example and template folders to differentiate the core functions.
Jumper  [author] 1 Nov, 2024 @ 7:23am 
[1/2]
If you convert the radar target to a global/world 3d point (x,y,z), then the code is mostly forward with how to map a point to the screen.
I used a personal Lua library, which doesn't make it quite forward with plug and play of the functions, which is a little bad on my part, as you would need to look though that library for whatever is needed, or know the SW VSCode extension for using custom libraries.

This is also using matrices to optimize for thousands of points, which takes more space than if you would have just done some vector calculations, which I've seen others that done so, some time ago. I don't have that implementation at hand, but that would've been a lot easier for plug and play to project 3d points to the hud.
Basharbobo1 31 Oct, 2024 @ 12:26pm 
is there a way to use this to pin point radar targets on a hud
Dolphin 23 Oct, 2024 @ 9:55pm 
military application when?
Jumper  [author] 2 Apr, 2024 @ 4:02am 
https://github.com/Jumper-44/Stormworks_AR-3D-Render/blob/master/Template/CameraTransform.lua#L99
There is a section for head_position_offset (approximation), also variable/vector for the relative position at the seat headrest block to the player head (When holdning nothing in hand).
That local position vector (head_position_offset) only depends on the seat look direction (and gender of player, defaults to male).

Picture of local coordinate space origin at seat headrest block:
https://github.com/Jumper-44/Stormworks_AR-3D-Render/blob/master/Pictures/Local%20Coordinate%20Space.png
Voss 30 Mar, 2024 @ 1:53am 
Would you consider publishing a standalone micro controller that just outputs the position of the player head relative to a point on the seat based on look direction?

I think it would help a lot of technical players including myself.
ZellyBelly 27 Mar, 2024 @ 3:36pm 
the next step is an entire functioning OS in stormworks.
lightnMCberger 23 Jan, 2024 @ 8:38am 
how do you learn to do this stuff
Jumper  [author] 1 Dec, 2023 @ 1:26pm 
@Voss
I've updated the github repo cameraTransform.lua and README.md
Jumper  [author] 28 Nov, 2023 @ 7:52am 
1.8 = 288/160
aspectratio = w/h

It was used to quickly get the correct aspectratio of the screen to run the "Quick debug" that is commented out. The sizeX|Y values aren't correct to match the 9x5 screen in game, but just the right ratio so the result isn't warped.
That's my bad, I haven't yet explained what each property paremeters are yet. I'll do a edit in cameraTransform.lua and configure the README.md to the github repo.

head_position_offset origin, or relative point, is in the center of the seat headrest block.
The headrest block is also the block that "GPS_to_camera" offsets to.
I.e. the offset from the physics block to headrest block.
Voss 28 Nov, 2023 @ 2:42am 
Additionally, when you calculate head_position_offset, what point is this relative to on the seat?
Voss 28 Nov, 2023 @ 2:39am 
I'm trying to understand your code:

In CameraTransform.lua, you multiply "sizeX" by 1.8, why is this?
Jumper  [author] 4 Nov, 2023 @ 2:15pm 
You could project the bullet trajectory, as in you constantly simulate you are shooing a bullet and see its trajectory over time, which results you seing the trajectory of, let say 60 bullets at a time and see the old trajectory to the newest in form of multiple points.
That would form a sort of arc of trajectory, but not a static bullet arc that falls towards the ground. Can be used to account for over/under shooting.
I think so, just thought of it.
christigpa 4 Nov, 2023 @ 1:38pm 
Could this techinically be used for a gun? like aimbot or smth, to indentify a target
John Man 11 Sep, 2023 @ 2:20am 
now run doom with it.
Grandpa Major 6 Nov, 2022 @ 4:39am 
SHut up!
Gnome 6 Oct, 2022 @ 9:28am 
░█░░░░░░░░▀▄░░░░░░▄░Toby wants to take over Steam.
█░░▀░░▀░░░░░▀▄▄░░█░█He needs your help.
█░▄░█▀░▄░░░░░░░▀▀░░█Copy/paste Toby to help him.
█░░▀▀▀▀░░░░░░░░░░░░█If not, he will use the Legendary Artifact's power. On you.
█░░░░░░░░░░░░░░░░░░█
█░░░░░░░░░░░░░░░░░░█
░█░░▄▄░░▄▄▄▄░░▄▄░░█░
░█░
Speckal 1 Sep, 2022 @ 2:24pm 
░█░░░░░░░░▀▄░░░░░░▄░Toby wants to take over Steam.
█░░▀░░▀░░░░░▀▄▄░░█░█He needs your help.
█░▄░█▀░▄░░░░░░░▀▀░░█Copy/paste Toby to help him.
█░░▀▀▀▀░░░░░░░░░░░░█If not, he will use the Legendary Artifact's power. On you.
█░░░░░░░░░░░░░░░░░░█
█░░░░░░░░░░░░░░░░░░█
░█░░▄▄░░▄▄▄▄░░▄▄░░█░
░█░
Lettuce 25 Jul, 2022 @ 11:20am 
Looks like it could be very useful for use in fighter jets
Doggo 24 Jul, 2022 @ 12:06am 
░█░░░░░░░░▀▄░░░░░░▄░Toby wants to take over Steam.
█░░▀░░▀░░░░░▀▄▄░░█░█He needs your help.
█░▄░█▀░▄░░░░░░░▀▀░░█Copy/paste Toby to help him.
█░░▀▀▀▀░░░░░░░░░░░░█If not, he will use the Legendary Artifact's power. On you.
█░░░░░░░░░░░░░░░░░░█
█░░░░░░░░░░░░░░░░░░█
░█░░▄▄░░▄▄▄▄░░▄▄░░█░
░█░
Jumper  [author] 17 Jun, 2022 @ 9:46am 
The laser is used to detect a collision and the specified point can be calculated which is then saved in a table in world coordinates (x, y, z), so the point will just float at that location and doesn't move.
You'd to use a radar/sonar if you want the point to follow, and maybe predict the future position of the target by 2-3 ticks for accuracy.
You could of course track a target with laser, but it'd be more complicated to remain locked or just finding the target without radar.
RandomGuy0400 17 Jun, 2022 @ 9:32am 
question: if you paint an object, then move the object, will the painted points remain floating where the object was, or will they stay attached?
RandomGuy0400 7 Jun, 2022 @ 10:57am 
I wonder if you could use this with the new sonar to generate 3d maps of your surroundings and stuff
Blurr 3 Jun, 2022 @ 5:07am 
How can you make this in stormworks
exr_879 30 May, 2022 @ 6:38am 
Augmented reality, is that right?
ninjabreadvan 26 May, 2022 @ 7:39am 
This is Toby.
░█░░░░░░░░▀▄░░░░░░▄░Toby wants to take over Steam.
█░░▀░░▀░░░░░▀▄▄░░█░█He needs your help.
█░▄░█▀░▄░░░░░░░▀▀░░█Copy/paste Toby to help him.
█░░▀▀▀▀░░░░░░░░░░░░█If not, he will use the Legendary Artifact's power. On you.
█░░░░░░░░░░░░░░░░░░█
█░░░░░░░░░░░░░░░░░░█
░█░░▄▄░░▄▄▄▄░░▄▄░░█░
░█░
Jumper  [author] 22 May, 2022 @ 1:34pm 
I've uploaded to pastebin now. Flaffipony server (ponybin) seems to be down, as I can't upload either. Thanks for the notice.
Static 22 May, 2022 @ 12:11am 
Looks like your flaffi pony link is down, mind re-uploading it?
joecaptain 18 May, 2022 @ 12:53pm 
Phenomenal :steamhappy:
drank on my paws 13 May, 2022 @ 6:37pm 
I have no use for this but it is absolutely amazing
Jumper  [author] 10 May, 2022 @ 12:20pm 
Yeah. I still need to make the head rotation offset more accurate.
I used CheatEngine to read the GPS coordinates of the head in real time, so I have the data of the points which are only slightly off, just haven't updated the code since I started on my jet (F35 B used for reference), and little burned out, but I'll get to that in the near future and update this.

You can improve it and upload it however you like, if it becomes the case of interest, but if it's an extention/improved version, AKA just the main part of a system, then just a mention would be appreciated, else if just part of multiple systems in a vehicle, then it's fine without mention.
mblaue04 9 May, 2022 @ 3:38pm 
you know, if we could link radar data and other systems to this it could be possible to make a device to find weak spots on a plane along with other vehicles. It could also be used to find those stealthy outliers. I may use this and improve it to fit on my mach 7 jet! i am not that good with hud projections but i will try to improve this to overall radar liking. Just for clarification i wont upload the improved virsion if i can make it
ironslayer12 6 May, 2022 @ 2:35pm 
im very confused?
BizKwikTwist 2 May, 2022 @ 10:42pm 
Runways at night could use this!
Rust 23 Apr, 2022 @ 3:54am 
I saw a thing about VR once in stormworks but it was just a gimble camera attached to a seat and 4 monitors
Dung3on_Master 20 Apr, 2022 @ 11:30pm 
I would love to see someone try and hook it up to radar, and draw points in a 3d space of radar targets.
Xtremely Moderate 20 Apr, 2022 @ 7:04am 
Holy crap i got the best idea from this, look at 30:30 in the video and go to the end of it and you'll get it (imagine making that into a stormworks creation).
https://www.youtube.com/watch?v=EOxarwd3eTs

The camera in the video makes it so you can see things like you do in AR, but it's a little more cursed/ungodly/lovecraftian-ish (watch content on the SCP Foundation for more context).
wolfin 20 Apr, 2022 @ 4:55am 
AR IN STORMWORKS hgmhmhmggmgm very epic
Boeroeng 19 Apr, 2022 @ 4:25am 
aw yep
kknd_3apa3a 18 Apr, 2022 @ 9:20pm 
first sight - I can imagine how it works but I`m pretty sure I won`t be able to implement this next 1000 years. great job.
ArcherDude11 18 Apr, 2022 @ 6:15pm 
epic lua scripting. I am too blown away to even fathom what I could use it for.
Kitsuneツ 18 Apr, 2022 @ 11:36am 
Wow, I could only imagine the hours upon hours of making this, I'm probably gonna start calling witchcraft soon!
Violent Nomad 17 Apr, 2022 @ 4:11pm 
I see these are excellent applications. Nice job on this! I can see this becoming even better in the future. Will you be incorporating this into any of your builds?
Jumper  [author] 17 Apr, 2022 @ 12:38pm 
@Violent Nomad
It can be used for LIDAR, where the points can be colored depending on distance or height like if points have an altitude of under 0, then you can just clamp it to 0 and have it blue for water, or different color if the points are higher or lower than your vehicle altitude. That way it is easy to see what is land, mountain or sea.
With distance you can also instead of just color, use circles to make the point bigger if close.

This is mostly useful at night, foggy, heavy rain, so general bad weather. If you don't have have windows or very limited vision in vehicles, it can give space perception or submarines, where vision is very limited.


You can view any position(x, y, z) in 3d space to debug or whatever systems you can imagine. radar position. Outline Runways on land or custom aircraft carriers, outline helipads. Navigation guidance.
Jumper  [author] 17 Apr, 2022 @ 12:38pm 
The code should be easy to edit, but of course you need to know lua and Stormworks onDraw() commands and depending on what you want to do maybe vectors and trigenometry.

At the top of the code (take a look), there is a screen configuration section which should be easy to configure.

In this code example, there is just over onTick(), a section for variables used in the demo.
Also mentioned in onTick() what is used for the demo.
In onDraw(), the first section is for setting up the camera transform, and a line under saying when you can draw.

The function WorldToScreen_Point(table), takes a single table as argument containing:
{ {x, y, z}, {...}, ... }
It returns a table: { {x, y, z, index}, {...}, ... }, where x and y are screen coordinates,
z is depth and the forth is the index of the table used as argument, since points not in view are clipped.
KeyboardLord 17 Apr, 2022 @ 12:24pm 
holy shit that's impressive, nice work
Violent Nomad 17 Apr, 2022 @ 11:24am 
What applications does this have and how can I modify it?
Nike 17 Apr, 2022 @ 10:31am 
cool
DinoDude777 16 Apr, 2022 @ 5:24pm 
holy