Dark Bit Factory & Gravity
PROGRAMMING => General coding questions => Topic started by: Stonemonkey on December 12, 2007
-
At present I calculate my vertex shading by transforming my camera to object space but I'm now wanting to be able to scale objects preferably by different amounts along each axis, is it still possible to transform the camera to object space taking the scaling into account and so be able to calculate the shading so it's correct for the scaled object in world space?
I'd like to be able to do this to avoid having to transform the normals and re-normalise them.
Cheers, Fryer.
-
I'm not sure if it can, I can see it being done in 2d but having problems seeing it in 3d. Still, if anyone has any ideas about it...
-
I think in general you need to recompute the normals. If your scales aren't too extreme, you could light it and then scale it? It would be wrong, obviously, but it would look pretty much OK.
Jim
-
I've pretty much come to that conclusion but there is something I'm going to try before giving up and settling for re calculating the normals.