normals

Calculation of vertex normals in DirectX

As a learning experience, I'm writing an Immediate mode managed DirectX 9 application. I'm manually calculating Vertex normals across all triangles in a scene to allow smooth Gouraud shading. This works as expected, but I'm guessing this is not the most efficient approach. Is it possible to get the GPU to do this for me? ...

Normal of an equilateral triangle that has been arbitrarily transformed in 3D space

I have an issue that I can't quite seem to find a starting point on; I'm not even sure I can describe it well enough to get an answer. I need to find the normal of an equilateral triangle in 3D space without knowing the points of the triangle beforehand. Think about taking a photo of a triangular "yield" street sign from any angle, and...

Getting normal information from OpenGL render output

I'll try to keep this simple. I want a way to access the normal information of the scene, from the Frame Buffer output (or similar). The same way one is able to access the Depth Buffer using glGetTexImage and GL_DEPTH_COMPONENT. I know I could set up a fragment shader which outputs the normal information in RGB color space, which could...

How many normals?

if you are calculating the normals of a polygon for rendering it on WebGL, do you use a normal for every index in the index array or for every vertex on the vertex array? ...

Could somebody explain how to use glDrawElements (iPhone)?

Sorry for the duplicaiton, but I've been googlin' for hours now without any result. I have this (optimized) data of a simple cube exported from a converter: // 8 Verticies // 4 Texture Coordinates // 6 Normals // 12 Triangles static GLshort cubeFace_indicies[12][9] = { // Box001 {2,0,3 ,0,0,0 ,0,1,2 }, {1,3,0 ,0,0,0 ,3,2,1 }, ...

glDrawElements with indices applied to vertices and normals

Is it possible to use the glDrawElements method when you have lets say 2 arrays (one for Normals and one for Vertices) and use the Index-buffer interleaved between vertices and normals). EXAMPLE: rendering a Cube // 8 of vertex coords GLfloat vertices[] = {...}; // 6 of normal vectors GLfloat normals[] = {...}; // 48 of indices (even a...

Calculate if two 3D triangles are on the same plane

For a 3D game engine I'm working on I need to calculate if two 3D triangles are on the same plane to display it accordingly. How do I calculate the angles of a triangle in 3D space? Would calculating a surface normal and comparing those ever give me 2 equivalent normals? ...