symek Posted September 29, 2006 Share Posted September 29, 2006 Hi there, I'd like to find a geo (point) position in NDC but not in rendertime but in UI? Is it possible? I was thinking about creating Camera vector (Add point in Camera geo, add normal to it) and then compute angle between this one and look_at vector from camera to my geo. Then *somehow* I could find my XY. For example there must be some relation between this angle(eye & lookat my_point) and horizontal&veritcal focal angles... any ideas? thanks in advance! Sy. [EDIT] Ok, found this on odforce.net/tips : vector toNDC(vector p, float zoom) { float z; z = zoom / p.z; p *= set(z, z, 1); p += {0.5, 0.5, 0}; } sop vel_blur(matrix4 camera=1; float focal=50, aperture=42) { float zoom; vector p0, p1; vector screenV; zoom = focal/aperture; p0 = P; p1 = P + v; p0 *= camera; p1 *= camera; toNDC(p0, zoom); toNDC(p1, zoom); ... } Is this is what I was looking for? (not sure) Is it still usable? Quote Link to comment Share on other sites More sharing options...
ptakun Posted September 30, 2006 Share Posted September 30, 2006 Czesc Symek!! Look at example: Cam_to_NDC.hipnc Cheers! Quote Link to comment Share on other sites More sharing options...
symek Posted September 30, 2006 Author Share Posted September 30, 2006 But how?, what a hell? That was the answer... and it couldn't be easier... i'm afraid.... thanks ptakun! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.