Jump to content
Sign in to follow this  
Noobini

Volleyball

Recommended Posts

So someone posted "I modelled a soccerball".......really ? It's virtually pre-made for you in Houdini already.

Here's a tougher challenge, procedurally model a volleyball....not just the standard 3 stripes....how about ANY number of stripes ?

Won't post file yet...so ppl can have a go themselves.

 

Share this post


Link to post
Share on other sites

Just take a box and let some sine waves run across its surface.

// INPUTS
int stripes = chi('stripes');
float diam = chf('diameter');
float bump = chf('bump');
float bend = chf('bend');

// GEOMETRY
vector nml = abs(@N);
vector bbox = relbbox(0, @P);

// SPHERIFY
@P = normalize(@P);

// SURFACE
vector shape = abs( sin(bbox * $PI * stripes) );
shape = pow( sin(shape), bend) * bump;

// STRIPES ORIENTATION
if( int(nml.z) ){ @P += @N * shape.y; }
if( int(nml.y) ){ @P += @N * shape.x; }
if( int(nml.x) ){ @P += @N * shape.z; }

// GROUP SEAMS
i@group_seams = length(@P) < 1.001;

// OVERALL SCALE
@P *= diam * 0.5;

volleyball.hiplc

volleyball.png

Edited by konstantin magnus
image editing
  • Like 1

Share this post


Link to post
Share on other sites

Ok, your topology looks more convincing. So I extrude the stripes, as well:

volleyball_making.png.9100eb8a0de6029239cb7bb999953541.png

  1. Add stripes on a box using relative bounding box coordinates.
  2. Spherify by normalizing point coordinates.
  3. Split by colours and extrude.
  4. Fuse and subdivide.

Here is the simplified stripe code:

int stripes = chi('stripes');
vector bbox = relbbox(0, @P);
vector nml = abs(@N);

if( nml.z > 0 ){ bbox.y = 0; }
if( nml.y > 0 ){ bbox.x = 0; }
if( nml.x > 0 ){ bbox.z = 0; }

@Cd = ceil(bbox * stripes) / stripes + @N;

 

volleyball_2.hiplc

Edited by konstantin magnus
  • Like 1

Share this post


Link to post
Share on other sites

Quite straight forward! You could also try copying your grid to an octahedron from platonic solids.

grid_to_platonic.png.cdecb6cdf3b421b28232166e39b8331d.png

However, this requires to handle the orient attribute on the platonic first.

vector up = v@N.zxy;			// assign swizzled normal vectors to up
matrix3 rot = maketransform(v@N, up);	// rotation matrix based on normals and up
p@orient = quaternion(rot);		// convert rotation matrix to quaternion (vector4)

 

copy_grid_to_platonic.hiplc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×