Geometry to grid faces

   7164   7   2
User Avatar
Member
36 posts
Joined: Oct. 2007
Offline
Hi,

I'm trying to copy geometry to a grid/surface, so that the shape of the copies follow deformations of the grid.

For example, if I copy a square to the grid, I'd like the four corner points of the square to match four grid points (instead of one square being centered around each grid point, as normally with the Copy SOP).

Sorry if I'm unclear… Another way to put it: I want a matching copy on each surface quad or polygon.

Thanks, Fredrik
User Avatar
Member
36 posts
Joined: Oct. 2007
Offline
Ok, so I've managed to do this with squares by matching all my copied squares point numbers to a grid's point numbers with a Point SOP. It works.

But I'd like to be able to do the same with any “input” geometry. However, since my grid “cells” only have four corners it goes crazy (of course) if my input objects have more than four points.

Sorry if this is a basic question, I'm new to the program.

I'm grateful for any help!
User Avatar
Member
34 posts
Joined: May 2007
Offline
Off the top of my head, one thing you could do is create a point using an add sop and copy this to your grid.
Inbetween the add and the copy sop you can place a transform sop to move the point so tat it is copied to the centre of each cell of the grid rather than to its points.
Delete any of the points that you do not need and then copy the object to these ne points rather than to the grid.

Im sure there's something more elegant and if I have time I'll ave a look.
User Avatar
Member
2199 posts
Joined: July 2005
Online
you could convert your grid to polys, if it isn't already, add normals, then use a primitive sop and set the scale to zero. This should give you zero sized polys at the center of each original poly. Add an add sop and use the “delete input geometry but not the points”, then delete 3 in every 4 points with a delete sop and finally use a copy sop to copy your geometry to the points.

Much the same as the above reply, but no translating required.
The trick is finding just the right hammer for every screw
User Avatar
Member
1904 posts
Joined: Nov. 2006
Offline
The following sprung to mind when I first read this thread.

Attachments:
creepongridfaces.hip (50.5 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
36 posts
Joined: Oct. 2007
Offline
Thank you for the answers. Grahamt, that solution was very interesting! Tried to replace the box with a skin surface, works great. Exactly what I needed.

If I was to take it further, could you think of a way of doing a similar thing with more complex geometry? E.g. replacing the box in your example with a “component” made up of multiple pieces of geometry. Some kind of bounding box solution perhaps?

I suppose it calls for another kind of solution if the Creep SOP cannot be used.

Thanks, Fredrik
User Avatar
Member
1769 posts
Joined: Dec. 2006
Offline
hi!

Another simple solution is to emit particles from prim centers at frame 1 and copy your geo to those points.
Use impulse birth and use nprims() in birth rate fields, disable inherit velocity
however particles will not stick if You animate the geo.

cheers
daniel bukovec | senior fx td | weta digital
qLib -- http://qlab.github.io/qLib/ [qlab.github.io]
User Avatar
Member
36 posts
Joined: Oct. 2007
Offline
Hi!

I have one more question: I'm trying to use grahamt's solution (as posted above), but with a triangular creep geometry and a triangulated grid. However, I can't get the geometry to fully “fill” the grid faces (as it does with quad geometry).

Any suggestions? I'd greatly appreciate some advice.

Best, Fredrik
  • Quick Links