Jump to content

Noobini

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.

 

Link to comment
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
Link to comment
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
Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...

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...