• Create Account

mv348

Member Since 05 Oct 2011
Offline Last Active Jul 28 2015 09:38 AM

In Topic: Right vs Left-Handed Matrix Representation

28 July 2015 - 09:41 AM

This relates to the cross product. There is a way to determine the direction of the cross product of two vectors, using the "right hand rule" - in short, to determine the direction of (A cross B), you orient your right hand such that you can sweep your fingers from A to B. Your thumb will point in the direction of the cross product. Google "cross product - right hand rule" for better pictures and explanations. But you could redefine the cross product by using your left hand - this will just reverse the direction of the resulting vector.

you can determine the Z vector of your coordinate system by taking the cross product of the X and Y vectors (or in other language, get the k vector by taking the cross product of the i and j vectors).  If you find the z direction by using a right handed cross product of x and y, its a right handed coordinate system. Likewise for a left handed cross product, and left handed coordinate system.

Hope that makes sense. But in short, the z vector is reversed.

In Topic: Capsule line intersectionpoint only

24 July 2015 - 12:29 PM

Maybe someone else will but I'm definitely not quite understanding your question. Could you give more details or post a diagram?

I implemented capsule collisions once.. to the best of my memory, to determine the closest point on a line to a capsule, I checked the distance between the two center center points to the line (point to infinite-line distance calculation) and then the distance between the line and the straight section of the cylinder (infinite-line to infinite-line distance calculation), and then projected the resulting closest point onto the line segment connecting the sphere center points to see if it was inside the cylinder portion. I had some simple logic to determine which of the 3 options was closest.

In Topic: Can't get simple Tesselation Shaders to execute

28 April 2015 - 11:49 AM

Thanks everyone.

It turned out the problem went away when I explicitly set the attribute layout locations in all the shaders (tesselation control, tesselation evaluation, and fragment shader). Initially I was only doing this in the vertex shader.

It seems odd to me. I had thought that if your vertex shader sets the position of each attribute, the subsequent shaders would assume the same convention provided they were listed in the same order and had the same type (which was the case).

Should this really have been necessary?

In Topic: Trouble reading from depth-texture

29 July 2013 - 10:17 PM

Yep! I set 7 as the active texture unit, bind the texture,and then set 7 as the value of the gCascadedShadowMap texture uniform.

I was hoping someone might now what possible things could 'block' the texture from being read from? Are their constraints on the bind states of the frame buffer objects? I've tried binding and unbinding the relevant frame buffers in various places, but I'm sure I've not exhausted the possibilities.

In Topic: FBO - Render to texture not working

21 July 2013 - 05:15 PM

Fixed a small bug - I forgot to reset the glClearDepth to 1.0f after setting it to 0.25f. But still not working.

I think it has something to do with my gBuffer. My gBuffer has 4 color textures and a depth/stencil texture attached to its FBO. The shadow map FBO has only a depth texture attached. When I do my light pass I have my g-buffer fbo bound, and then I bind the shadow-map's shadow texture to an appropriate texture unit. It appears as if the gBuffer cannot "see" the shadow texture sitting in the unbound FBO. By my understanding I thought this would work but is there some technicality here that I'm not aware of?

PARTNERS