Tag Info

New answers tagged

1

The problem is that you are running your mouse coordinates through Camera.main.ScreenToWorldPoint twice. var v3 = Input.mousePosition; v3.z = 16.0f; v3 = Camera.main.ScreenToWorldPoint (v3); Vector3 worldMousePosition = Camera.main.ScreenToWorldPoint (v3); Deleting the 3rd line will help. When you also have the problem that you are ...


0

I've found what I've done wrong: for (w = 0; mask[sum + w] == type && !done[sum + w] && w < 15 - x; w++) {} The code above was wrong, because it incremented w first and then it checked everything. Therefor the code should be: for (w = 0; w < 15 - x && mask[sum + 1 + w] == type && !done[sum + 1 + w]; w++) {} This ...


-1

Raycasting is what you want. As far as I know Minecraft uses raycasting aswell. How it works is basicly, that you send a "ray", represented as a 3D vector from the middle of your camera. The voxel you look at then is the first one the ray " collides with. ThinMatrix made a tutorial on ray casting.


2

A Vertex Buffer Object (in short VBO) is an object(buffer) that holds vertex data. It's your job, as the programmer, to fill the VBO with this data (usually Vertex positions, texture coordinates and normals) and then send it to be handled by the GPU. This is an example of VBO initialization: glGenBuffers( 1, &vbo ); // Generate a VBO handler ...


0

VBO's (Vertex Buffer Object) are used to upload data to the GPU (Graphic Processing Unit, in other words your graphic-card). The data does not have to be vertices, it could be used for anything. The data can also be changed later on.


0

Basically its what @DanielHolst said, you can use negative coords and expand in all directions. As for storing your loaded chunks for fast access and checking you could use std::unordered_map, Just #include <unordered_map>, then your code looks something like this: std::unordered_map< std::pair< int, int >, Chunk* > ChunkMap; // For ...



Top 50 recent answers are included