fenomas / noa

Experimental voxel game engine.
MIT License
612 stars 87 forks source link

Voxel Size #10

Closed andrewtheone closed 8 years ago

andrewtheone commented 8 years ago

What should i tweak to resize voxels? (all of them, lets say make them 0.25_0.25_0.25 unit instead of 1_1_1)

fenomas commented 8 years ago

Hey, sorry for the consistently late replies.

For voxel size, there is no built-in way currently. I experimented with this some, and I wound up not putting in a scaling factor because, as near as I can tell, voxel size is essentially a matter of camera position and settings. That is, if the camera is about 1.6 voxels off the ground then the voxels appear Minecraft-sized, but if you set the player height to 5 voxels, and maybe change the FOV, then effectively the world is now made up of much smaller voxels. Since there's nothing in the world except voxels and the player, making the voxels smaller is the same as making the player bigger, does that make sense?

Anyway if you want to try hacking on it, you could try scaling the actual vertex positions as they are written into the voxel mesh, here. However I'm sure there are a bunch of other things that would need to be fixed, and I'm not quite sure how many.

fenomas commented 1 year ago

@JaegerBomBYT This engine uses Babylon.js internally, so most non-voxel customizations are done by changing babylon object properties. In this case, babylon cameras have an "fov" property, and by default noa stores its camera at noa.rendering.camera, so you can do something like this to change the fov:

noa.rendering.camera.fov = 0.5