Skip to main content
GameDev.net gamedev.net
🔒 Locked

metric tensor

Started by vaneger Dec 28, 2003 at 10:26 PM 2 replies 750+ views
Original Post
vaneger
vaneger
what is it and could it be used in games?
teamonkey
teamonkey
The Metric Tensor is a matrix used to define the geometry of space, so you could probably use it for some cool distortion effects in games.

For flat space, the tensor is:
[ i 0 0 ]
[ 0 j 0 ]
[ 0 0 k ]

When you multiply that by a vector (x,y,z) you get (i*x,j*y,k*z), so by changing the values of i,j,k to something other than 1.0 you can stretch space. By fiddling with some of the other values in the tensor you get a "non-flat" space. Try it and see what you get

Disclaimer: some or all of this may be wrong. It's been a long time since I did anything to do with tensors.

[teamonkey]

[edited by - teamonkey on December 29, 2003 4:32:53 AM]
[teamonkey] [blog] [tinyminions]
elengyel
elengyel
The metric tensor is used to generalize concepts like distance, volume, and the dot product to arbitrary curvilinear coordinate systems. For example, the 3D dot product is generalized to

U dot V = sum(g[i,j] * Ui * Vj),

where g is the 3x3 metric tensor and the sum ranges over all values of i and j between 1 and 3. In flat Cartesian coordinates, g is the identity matrix and the above equation reduces to the conventional dot product.

This is probably major overkill for games, unless you're planning to simulate general relativistic effects. Nevertheless, I do include a short dicussion about the metric tensor in Appendix C of my book, Mathematics for 3D Game Programming and Computer Graphics:

http://www.terathon.com/books/mathgames2.html


[edited by - elengyel on December 30, 2003 4:14:37 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.