Jump to content

Point Position In Ndc


symek

Recommended Posts

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...