So.. Snap! has 3D now :)

I just finished an FPS Test with a room and stuff. Unfortunately if you're planning ON making an FPS Shooter the gun, or any other pickup item, has to be a separate sprite: it would be too expensive to render the gun in 3D.

Unfortunately textures can't be loaded in, which is fine if you're just making a simple 3D FPS.

MUST BE LOADED IN THE EDITOR.

it doesn't work for me (i think its cuz its not in the dev version, the beetle library isn't in the libraries list and it's missing the button for 3D view)

image

image

I originally thought rendering 2D planes in the 3D world would save some CPU Usage but it uses more CPU Usage than just putting the character inside a cube.

https://snap.berkeley.edu/versions/dev/snap.html#present:Username=slate%20technologies&ProjectName=FPSTest_Beetleblocks&editMode&noRun
this link works for me

Bromagosa, even though you're working on this, I don't think you should give up on the BeetleBlocks project as a separate thing

Yes please. I really want the BeetleBlocks Extension to continue development so I can effortlessly make 3D Games.

So... I decided to create blocks to control the camera programmatically. Just to be clear, this is already possible using the first person view, but it is locked onto the beetle, so you can't see it. I added a separate camera, which can be controlled independently from the beetle. This is also a proof of concept, so there are bugs that I don't feel like fixing (as it's messing with an in-dev javascript library).

https://snap.berkeley.edu/versions/dev/snap.html#present:Username=ego-lay_atman-bay&ProjectName=3d%20beetle%20free%20camera%20poc

Since I am using javascript on an in-dev javascript extension, PLEASE do not report any bugs using this. I also do not expect bromagosa to ever implement this, as it's not in beetleblocks, so please don't bug him to add it.

A note

This was much easier to implement than in beetleblocks, because beetleblocks has some weird rotation behavior that is thankfully not in this library.

not to be that guy but its not working :(
Anyways I made this in history class, which is a third person view of a controllable cube

Oh yeah, I know what I did wrong, I forgot to set a variable (I had set it in the console, and I forgot I also had to set it in the javascript functions). It should be fixed now.

I also noticed a little weird thing. If you click on the 3d window, snap can't detect key pressed, so you have to drag (not click) something outside the 3d window, and then snap will be able to detect key presses.

yeah, i thought the key press thing was intentional

Huh? I just woke up, man, I need a minute to process all of this...

Oh yeah, I wrote that an hour ago, and in that hour I made this!

https://snap.berkeley.edu/versions/dev/snap.html#present:Username=tethrarxitet&ProjectName=3d%20test%20lol

(I don't know how to properly frame a project.)

Interesting, but I can't seem to do anything. I went to the link, and it said there was a missing extension. I toggled extensions on, but I still couldn't run it.

Try going to the category then press Open 3D Window, close it, then press the green flag again.

WOAH IT ACTUALLY WORKED! :exploding_head:

Yeah. The category needs to get to the library by pressing that button for some reason. bromagosa should fix this or integrate it into Snap! so it doesn't need a kickstart.

Ok.

It's a small little landscape with trees and rocks.
Of course, you can walk around it, like many other projects here.
The code's obviously a mess though, I'm nowhere near used to creating walking scripts in 3D despite the fact it should be the exact same as coding walking in a top-down space.
Anyways, here's the link to it.
If the map takes really long to build, click into the category, open the 3D window and then run the project.
Oh, you also need to click on the reset block to fully initialize it.

oh my god eveything is green now

Just open the 3D window while the map is still building, i have no idea why it works or why it only sometimes does but just keep trying to rebuild the map and doing this. it should work.

Remember: this isn't even in beta yet

Yeah, sorry.
I'd had frustrations with this before, the ground kept matching the colors of the rocks, then the rocks kept matching the colors of the ground.