Pages: 1 2
Author Topic: Need Help Creating 2D Shadow Casting (e.g. Teleglitch)  (84,411 Views)
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #15 Posted on: August 07, 2013, 09:08:12 AM
True, Harri, but what I find interesting, why you have to do the +1 with the other projection functions, it seems like you should be able to flip the upvector around to make it work.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #16 Posted on: August 07, 2013, 01:10:26 PM
I guess you could. I didn't really test it (I forgot what the last 3 arguments did), so I just thought about it like a "point_to" function. So point from x,y,z to x,y,z+1, which just mean point in the positive z direction and that is just straight down (or the reverse, I can't even remember if the axis was in positive or negative z direction in OpenGL).
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #17 Posted on: August 07, 2013, 02:21:12 PM
I don't know, I was just doing the same thing the other day though when working on D3D9 sprites to see if I could do transforms on them to make them billboards. Direct3D and OpenGL though require the same transformation to an ortho projection to make it not be flipped upside down. I think that is dumb they should just do it by default, especially when the sprite and 2D transform functions work the correct way, eg. render targets and surfaces too.
Pages: 1 2