Tag Info

Hot answers tagged

11

Because if you only divide [x, y, z] by z you get [x/z, y/z, 1] and you lost the actual value of z, which is actually useful if you want to do near/far plane clipping or fill a Z-buffer. The best way to keep some information about z, at least on the GPU, is therefore to use 4 components instead of 3. In practice, what is actually in the last two vector ...


2

1)Create a plane that usually contain a point and a normal that represents the floor. 2)Reflect your camera position and rotation from this plane. 3)Create a view matrix from these point and rotation. 4)Render scene from this matrix into a texture. 5)Transmiss those texture and matrix into a shader. 6)Project texture onto a surface of floor using ...


2

Technically, you could do that. But why bother? By the time you have that final z, you could either: construct a 3x3 matrix as you described, wasting 9 * sizeof(float) bytes of space, spending cycles to compute 1/z (one division) and then doing nine multiplies and six adds to get your final vertex, or you can do three divisions, as the modern pipeline ...


2

In matrix multiplication, each index in the resulting matrix is the dot product of the ith row in matrix A and the jth column in matrix B: Cij = A.row( i ) . B.col( j ); Say we have this matrix, which represents indices in row-major representation, Indices in row-major representation 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 In row-major it will ...


2

The best paper out there for performance comparison is from geometrictools according to the paper you need 12 multiplication and 12 addition to convert a quaternion to a matrix, but this is hardly a deciding factor.. you need to look at the bigger picture Quaternions are great for interpolation because they are numerically more stable than matrices when ...


1

Since you are working in 3d world space, why not use the BoundingFrustum class? BoundingFrustum cameraBounds = new BoundingFrustum(view * projection); if(cameraBounds.contains(location)) { // it is in view } else { // not in view } edit. I assumed you are using XNA. If not, you can still reflect the XNA code to see how to make a Bounding frustum ...



Only top voted, non community-wiki answers of a minimum length are eligible