Camera-to-Clip questions
I am hoping somebody will be able to check this calculation for me:
When I convert a point in Camera Space (x,y,z) to Clip space (assuming that Clip Space is just a place where all your values are between -1 and +1) I have so far done this:
p.x = p.x * (2/screenwidth) OR p.x = p.x / (screenwidth/2)
p.y = p.y * (2/screenheight) OR you know what
Do you also have to do the same Camera-to-Clip calculation on your p.z value eg. multiply z by 1/dist where dist is your distance from the projection plane. I thought if you were projecting onto the standard z = 1 then the p.z value would not change at all because z * 1/1 = z.
I think the object in my program (a wall) is stuffed because I am doing the perspective by dividing x and y (clip coordinates) by z (world coordinate).
Does this make sense to anybody out there??
Thanks in advance,
Paulcoz.
Edited by - paulcoz on 2/3/00 3:01:21 AM
Hi,
I am not sure, but try to use z++ or something in the code. It just sais z + 1. Maybe that helps and if u modifie the code a bit. I am working on something thats almost the same as camera position, its the place of a object. And it almost works the same way, Y++ and stuff like that.
I am not sure, but try to use z++ or something in the code. It just sais z + 1. Maybe that helps and if u modifie the code a bit. I am working on something thats almost the same as camera position, its the place of a object. And it almost works the same way, Y++ and stuff like that.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement