pouët.net

Go to bottom

Shave me the math: plane projection

category: code [glöplog]
 
Let's say I have a uniformly tessellated grid, and I want to project it like this:

BB Image

My idea is to render an ocean or something like that.

How do I do something like this?
added on the 2012-04-03 02:37:23 by xernobyl xernobyl
Assuming the middle plane will be a height field, do you want the normals from which each height is measured along to be from the top plane or the middle plane? Or will the heights be along the lines formed from going from the 2D parameterization (with each corner being going from [0,0] to [1,1]) of the top plane to the middle plane?
added on the 2012-04-03 03:02:16 by QUINTIX QUINTIX
I don't really need the normals as long as I have the position, for what I want.

I've found the origin of the image here: http://habib.wikidot.com/projected-grid-ocean-shader-full-html-version

And proper math, and some code.
added on the 2012-04-03 03:05:06 by xernobyl xernobyl
xernobyl, simply take every vertex of your camera-aligned regular grid, create a ray that passes through it, and intersect that ray with the horizontal plane of the ocean. you'll see that it all reduces to a few multiplications and one division.
added on the 2012-04-03 18:57:35 by iq iq
wow nice article/wiki
added on the 2012-04-03 19:28:31 by pera pera
Frustum is such a dirty word, like 'parallel epiped'. It discerns not mathematicians from anglophiles; it fucks both in the ass.

Xernobyl: the article looks pretty complete...
added on the 2012-04-03 20:25:51 by Photon Photon
Photon: it is. But I've found the image before the article.
added on the 2012-04-03 20:35:50 by xernobyl xernobyl
Math Teacher shaves head bald in front of class:

[img]http://i.ytimg.com/vi/cEa3oYQbcaI/0.jpg[/url]
added on the 2012-04-04 19:13:25 by すすれ すすれ
Bleh

BB Image
added on the 2012-04-04 19:13:43 by すすれ すすれ
so we will have shaved heads and realtime ocean at REVISION?!?! :D
added on the 2012-04-05 17:41:55 by dirtie dirtie

login

Go to top