Screen-space based lattuce deform

   3445   4   2
User Avatar
Member
65 posts
Joined: July 2008
Offline
Hi!

I wanted to create a tool that is a lattuce deformer but in screen-space of a given camera. So the lattuce grid would be shaped rather like a viewer frustum than a cube. Then I'd like to feed NDC coordinates to each destination point that works in screenspace.

So I started with a lattuce and for now projected the entire lattuce on a grid through a camera. This is where I ran into problems:

I projected the lattice onto a grid using “User Defined” axis and the vector is calculated by subtracting the lattice point position with the camera position (nothing fancy). I'd expect that vector to project the lattice onto the grid so that when looking through the camera the source grid and projected grid would entirely overlap. But that's not the case (see image).

Then the second problem I'm running into is that the lattice SOP errors because the project SOP is adding the projection and source lattice geometry to the stream so that the lattice resolution does not match anymore.

Any ideas so far?

Thanks a lot!


Nhat

Attachments:
20140509_projectGeo.jpg (879.1 KB)

User Avatar
Member
65 posts
Joined: July 2008
Offline
Ok, so the first problem can be solved if I used point(…) instead of detail, but where do I get the point_number attribute from??
User Avatar
Member
245 posts
Joined: Sept. 2011
Offline
Do you mean the “point_number” part from the expression?

If you dont want to reference any specific pointnumber you can reference all of them using $PT, but I actually dont really know where you are using the point() expression, what are you trying to do with it?
User Avatar
Member
65 posts
Joined: July 2008
Offline
yes exactly. But $PT is not accessible in that context. There must be a way to get the point number for a given point though.
User Avatar
Member
65 posts
Joined: July 2008
Offline
I'm using the point() function to assign a projection vector that varies over each point. I got it to work with the detail() function, but that just creates a uniform projection vector.
  • Quick Links