Category : 3d-rendering

I am making a 3D game using SFML. I want to use normals to check if the triangle need to be draw in a terrain (triangle) mesh.Here is my code: vec3d line1, line2, normal; line1.x = terrain.tris[i].p[0].x – terrain.tris[i].p[1].x; line1.y = terrain.tris[i].p[0].y – terrain.tris[i].p[1].y; line1.z = terrain.tris[i].p[0].z – terrain.tris[i].p[1].z; line2.x = terrain.tris[i].p[1].x – terrain.tris[i].p[2].x; line2.y ..

Read more

i’m learing OpenGL Tutorial(https://learnopengl.com/Getting-started/Hello-Triangle) The following part of what I don’t understand. The purpose of the primitive assembly step is to convert a vertex stream into a sequence of base primitives. For example, a primitive which is a line list of 12 vertices needs to generate 11 line base primitives. The full primitive assembly step ..

Read more