'stick' object to surface of sphere

   7176   3   0
User Avatar
Member
1 posts
Joined: April 2015
Offline
Hey all,

This is probably a pretty simple problem; I am creating a tiny planet with roughly 10-20 large buildings stuck to the surface of the planet. I want to be able to grab a building and move it around while it sticks to the surface of the planet as while as maintaining proper orientation away from the surface. Having a control to rotate each building on the other axis is another goal.

Logically it seems simple. I don't know if I need to write an expression to limit the position each building to a specific distance from the planet (which I don't know the math for….I don't know how to translate distance from a point into position…), or if there is a node workflow that would do this…

I've managed to to populate a bunch of ‘buildings’ on random points that were generated using scatter; creating normals, carrying them through to the copy node, ete. This was all inside the sphere object that I created, and I don't know if I should be ‘rigging’ this at the top obj level or inside of an object.

Thanks!
User Avatar
Staff
3465 posts
Joined: July 2005
Online
I'd do this at the object level…
have a sphere object
and then a Building object (you can have multiple buildings inside)
you can use a rivet or sticky to place the buildings - both of these tools will allow you to transform the buildings while still ‘sticking’ to the surface…
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
5100 posts
Joined: Feb. 2012
Offline
If your sphere is NURBS geometry, you can get P using the prim VEX function and it would perfectly mapped in U and V.

You can also use polar coordinates. Or just trigonometry like the file below.

The normal is always gonna be away from the center of the sphere.

Attachments:
on_sphere.hip (123.9 KB)

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Staff
3465 posts
Joined: July 2005
Online
and don't forget the Creep SOP!
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
  • Quick Links