03-23-2022 02:57 AM
I am in the making of a Multiplayer shooter in labview as a school project i immediatly went overboard with.
i have been able to construct a map and a boundary so the player doesn't run off the stage and float into infinity.
but now i am the stage of adding the guns and i am having a bit of trouble of how i want/can add them.
since the inspiration was a doom like shooter. So i wanted to add a 2d overlay over the 3d scene but i don't have any idea how i would even begin to do that much less animate it.
then i attempted to just add a 3d model of a gun but the problem is this would be just a meticulous to add as the map i made.
so i was going to go with a gun model to the side and not actually having it in the scene but just in case i wanted to ask if anyone knows any better way?
Ps i added my mess of a project so far below this if you wanted to see what i have done so far
Thanks for your time in advance,
Dslayer
03-23-2022 02:58 AM
files
03-23-2022 06:34 AM
@Dslayer wrote:Ps i added my mess of a project so far below this if you wanted to see what i have done so far
It's in 21, so not a lot of people will be able to open it (being stuck in older versions to support ongoing projects).
But the fact that your application is 2 VIs isn't a good sign.
Games typically benefit a lot from object oriented programming. Of course you'd need a good plan, but when done right, scaling up (adding stuff) will be a lot easier.
Even without OO, you should really split things up in logical units. Divide and concur...
Simply putting everything in one (or two) VIs will drive even the most seasoned programmer insane. So well done achieving what you have, I guess 😂.
03-23-2022 08:26 AM
@Dslayer wrote:
So i wanted to add a 2d overlay over the 3d scene but i don't have any idea how i would even begin to do that much less animate it.
remind me of
https://forums.ni.com/t5/LabVIEW-Development-Best/LabVIEW-3D-Space-Explorer-Gam
03-23-2022 02:49 PM - edited 03-23-2022 02:49 PM
Unless you have a small "screen" (a picture box), your game will suffer because LabVIEW graphics are not accelerated. (The option here is to use a .NET picturebox which will be accelerated, but it comes with implementation baggage.)
03-23-2022 09:27 PM
Hi Dslayer,
That sounds like a cool project. It's great when people push LabVIEW into traditionally non-LabVIEW areas. I'm still on LabVIEW 2020 so can't view the code, but I'm guessing it's 3D picture control based, and you've constructed a 3D scene graph? It might be worth saving the code for a previous version through File -> Save For Previous Version and reposting it so more people can access it.
One way to quickly add a 2D overlay is with a 2D picture control. It can placed over the top of your 3D scene, and then set it's background / border to transparent with the color tool. Then you can draw your HUD to the 2D picture control, making sure to keep transparent pixels where you want to see your 3D scene.
Another option is one of more 2D picture rings, again placed on top of the 3D scene and the background / border set transparent. You can then insert a series of images into the picture ring (say for the gun firing animation). When the player fires the gun, you'd loop through each of the picture ring images before returning to the default gun frame.
I don't know if you saw this, but there is a simple 3D FPS written in LabVIEW on github, and includes a 3D gun. I tried it out a while ago, but without hardware it ran a little weirdly on my machine. Check out the video:
The comments on objects, more modular code, and fill rates are valid, but I wouldn't worry too much about that just yet. You can always optimize later. Assuming you're using the 3D picture control, it is OpenGL based and can handle large-ish 3D scenes, such as this 3D Racesim written in LabVIEW (video, source download).
I've written a few game-type LabVIEW projects which all use standard LabVIEW controls, mostly intensity graphs / 2D picture controls, combined with some of the tricks I described above. Check them out below if you're interested.
Wolfenstein 3D style renderer (LabVIEW and intensity graph, or LabVIEW FPGA and VGA video signal generator)
Source code: Link
Video:
DOOM PSX Fire (LabVIEW and intensity graph)
Source code: Link
Video:
SimCity 2000 Toolkit for LabVIEW (LabVIEW, combination of gifs, floating windows, picture controls)
Source code: Link
Video:
LabWad DOOM WAD File Viewer (LabVIEW, 2D picture control, intensity graph)
(I didn't write this one, but converted it to use a picture control instead of IMAQ. This uses the 2D picture control overlay technique with the background fire)
Source code: Link
Video:
03-24-2022 04:10 AM - edited 03-24-2022 04:41 AM
hey Dataflow_G,
thank you for the advise, i diden't know you could place a 2d picture box over a 3d on and keep part of it transparent thank you.
in the mean time i have attempted to make some 3d guns and use those but it just diden't look as good as i wanted them to so im going to attempt some pixel art for the project.
although its acting strange because it isen't allowing me to overlay the 2d picture box over the 3d one. the element is literaly over it but the thing the 2d picture box drew is under what the 3d one drew.
Ps below here are are files saved in 20, 19, 18 and 14.
thank you for your time.
Dslayer
03-24-2022 04:41 AM - edited 03-24-2022 04:47 AM
@billko wrote:
Unless you have a small "screen" (a picture box), your game will suffer because LabVIEW graphics are not accelerated.
What does that mean? A small "screen"? A picture box? You mean a 3D Picture control?
What else would you use to render 3D content? And what is wrong with a 3D Picture control? Why would it be a small "screen"? You can scale it any size you want to.
The 3D Picture control is accelerated (OpenGL)..
Sooo many questions...
03-24-2022 04:58 AM - edited 03-24-2022 04:59 AM
@Dslayer wrote:thank you for the advise, i diden't know you could place a 2d picture box over a 3d on and keep part of it transparent thank you.
That doesn't work.
The 3D Picture control renders itself quite aggressively. Noting on top of it is actually drawn on top of it.
Only another 3D Picture control is rendered over a 3D Picture, but you can't make it transparent.
You'd have to render the 3D Picture to a bitmap, and draw that in a 2D Picture control, and draw in that or put things over it.
03-24-2022 05:44 AM
wiebe@CARYA wrote:
@billko wrote:
Unless you have a small "screen" (a picture box), your game will suffer because LabVIEW graphics are not accelerated.
What does that mean? A small "screen"? A picture box? You mean a 3D Picture control?
What else would you use to render 3D content? And what is wrong with a 3D Picture control? Why would it be a small "screen"? You can scale it any size you want to.
The 3D Picture control is accelerated (OpenGL)..
Sooo many questions...
Can't edit this anymore...
If you thing the 3D Picture controls isn't accelerated, your comment makes sense.
But the 3D Picture control is GPU accelerated.
You don't have to keep it small.