Jump to content

  • Log In with Google      Sign In   
  • Create Account

Eric Lengyel

Member Since 25 Nov 2003
Offline Last Active Jul 21 2016 08:37 PM

Posts I've Made

In Topic: Stencil Shadows Problem

01 June 2016 - 02:57 AM

the stencil operation that i am using now is to increase, render my shape, then flip the culling and increase the stencil again

 

This part doesn't sound right. One side should increase, and the other side should decrease. Your shadow is where the stencil ends up being nonzero.


In Topic: Plane equation, + or - D

19 May 2016 - 11:57 PM

A plane (a,b,c,d) is really a four-dimensional trivector, not an ordinary vector. When you take the wedge product of three points P, Q, and R, it naturally produces a plane in which d = -dot(N, P) = -dot(N, Q) = -dot(N, R), where N = (a,b,c). When you take the dot product between a homogeneous point (x,y,z,w) and a plane (a,b,c,d), you get a*x + b*y + c*z + d*w, which gives you the signed distance between the point and the plane multiplied by w and the magnitude of N. A positive sign in front of the d is the correct choice.

 

This kind of stuff is discussed very thoroughly in my new book that comes out next month:

 

http://foundationsofgameenginedev.com/

 

Dirk, when a homogeneous point is treated as a single-column matrix that is transformed by multiplying on the left by a 4x4 matrix M, a 4D plane must be treated as a single-row matrix that is transformed by multiplying on the right by the inverse of the matrix M. If the translation portion of the matrix M is not zero, then a plane will not be transformed correctly if you treat it the same as a point.


In Topic: Game frameworks and engines that aren't Unity, Cryengine, or UE4?

07 April 2016 - 04:29 PM

Judging by your description, you will like the Tombstone Engine when it is released at the end of May:

 

http://tombstoneengine.com/


In Topic: Wedge product / exterior product

05 April 2016 - 12:52 PM

The wedge product mentioned in that pseudocode is between two 2D vectors. Calling them U and V, this wedge product gives the following numerical quantity (which is technically a pseudoscalar or antiscalar, but it doesn't matter):

 

U ∧ V = U.x * V.y - U.y * V.x

 

I have a Grassmann algebra talk that provides an introduction to the wedge product:

 

http://www.terathon.com/gdc14_lengyel.pdf


In Topic: Any Good Resources on Animation/Programming-Based Mathematics?

25 November 2015 - 06:10 PM

You can find my latest slides about Grassmann algebra (which includes pseudovectors) from GDC 2014 here:

 

http://www.terathon.com/gdc14_lengyel.pdf


PARTNERS