Jump to content

konstantin magnus

  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won


Everything posted by konstantin magnus

  1. skin mirrored polygons

    Why dont you just extrude the shape to the center and mirror it afterwards?
  2. [Solved] Calculating offsets

    Cool, thank you!
  3. [Solved] Calculating offsets

    Why dont you publish your solution?
  4. Split a curve

    Although convertline already is mainly done in VEX , you could iterate over all primitives, delete them and create a new prim for each of its points. int pr_pts[] = primpoints(0, @primnum); for(int i = 0; i < len(pr_pts) - 1; i++){ int prim = addprim(0, 'polyline', pr_pts[i], pr_pts[i + 1]); } removeprim(0, @primnum, 1); Make sure to set the attribute wrangle to run over primitives.
  5. Select Pts with One Connection

    Or just i@group_ends = neighbourcount(0, @ptnum) < 2;
  6. Select Pts with One Connection

    In a pointwrangle or a group expression SOP: neighbourcount(0, @ptnum) < 2
  7. Full path from lens shader to detail attribute

    You were right: I just overlooked the bracket. I used the detailattrib to create getbbox_center(). Works nicely now, thanks!
  8. Full path from lens shader to detail attribute

    I wrote a lens shader in CVEX that is supposed to get some data from geo level (ie. a position to look at). Unfortunately no full path expression on my shader node does seem to work: detail("op:/obj/mesh/OUT"), "center", 0)
  9. Smooth direction to surface?

    For the target polyexpand produces a straight skeleton, triangulate2d converts it to convex triangles, divide (remove shared edges) and resample (subdivision curves) turns them into a smooth outline curve. As you suggested I used minpos() to get the directions from the circle points towards the target: vector dir = minpos(1, @P) - v@P; and intersect_all() would be for shooting rays from the outer circle to the original input shape: int ray = intersect_all(2, @P, dir, pos, prim, uvw, tol, -1); Hit play to see how it performs on different inputs. dir_to_srf.hiplc
  10. Make Curve In VEX

    I dont think the spline()-function does this for cubic splines. You can read about it here: http://www.sidefx.com/docs/houdini/vex/functions/spline.html But you could connect points to a curve and close it with an add-node and resample this to an 'interpolating curve' or a 'subdivision curve'. spline.hipnc
  11. Creating Normal from Diffuse texture

    Houdinis GameDev-Tools come with a COP node called "Normal from Grayscale" that should do the job. https://www.sidefx.com/tutorials/game-tools-normal-map-from-greyscale/
  12. Grid with round corners?

    You can procedurally grab the corners in a group expression: neighbourcount(0, @ptnum) == 2 Only the corner points have two neighbors. round_corners.hiplc
  13. the maximum value of an attribute

    You can fit-range an attribute with setdetailattrib() set to "min" and "max". 1st pointwrangle: setdetailattrib(0, 'height_min', @height, "min"); setdetailattrib(0, 'height_max', @height, "max"); 2nd pointwrangle: float min = detail(0, "height_min", 0); float max = detail(0, "height_max", 0); @Cd.g = fit(@height, min, max, 0.0, 1.0); fit_range_VEX.hiplc
  14. Creating a flat surface primitive

    A subdivision disc(?): 8-sided circle, divide (with bricker on), polyextrude inwards, subdivision. subd_disc.hiplc
  15. Normal Direction

    You can create and average direction vectors along the ellipse like this: // POINT NEIGHBOURS int pt_last = @numpt - 1; int pt_next = (@ptnum + 1) % pt_last; int pt_prev = (@ptnum != 0) ? (@ptnum - 1) : pt_last; // DIRECTIONS vector dir_next = normalize( @P - point(0, 'P', pt_next) ); vector dir_prev = normalize( @P - point(0, 'P', pt_prev) ); vector dir_avg = normalize(dir_next + dir_prev); // NORMALS v@N = dir_avg; avg_dirs.hipnc
  16. Understanding VEXpression

    /obj/light`int(fit01(rand($PT+1541)*2,1,2))` Start reading it from the center of the brackets: (rand($PT+1541) // A random value between 0.0 and 1.0 is created based on the point number ($PT) + an additional seed value (1541) *2 // The random value gets multiplied 2, so now it´s between 0.0 and 2.0 fit01( XXX ,1,2)) // This get fitted from 0.0 - 1.0 to 1.0 - 2.0 (so multiplying it by 2 has not made much sense imho) int( XXX ) // The whole thing is casted to an integer, so in this case either 1 or 2 ` XXX ` // The back ticks probably turn this into a string, so you can combine it with: /obj/light So I guess it would switch between two light sources named light1 and light 2.
  17. Fusion vs Nuke

    How about Natron? https://natrongithub.github.io/
  18. Volleyball

    Here is a tutorial on creating a procedural volleyball:
  19. distance bounding box values

    You can map the range of any distance/value with attribpromotes min and max functions. dist_range.hiplc The bounding box will give you the position coordinates of its bottom-left-front and the top-right-back corner, so I doubt it will be too useful right away. But maybe I got you wrong.
  20. Volleyball

    Quite straight forward! You could also try copying your grid to an octahedron from platonic solids. 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
  21. Volleyball

    Ok, your topology looks more convincing. So I extrude the stripes, as well: Add stripes on a box using relative bounding box coordinates. Spherify by normalizing point coordinates. Split by colours and extrude. 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
  22. Volleyball

    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
  23. Brick Tube with a bend

    You can promote the ranged point group to edges and dissolve those. brick_pipe.hiplc
  24. Zahia Hadid Architechture

    Watch Junichiro´s channel to see how surface population can be done in Houdini or optionally in Rhino, as well: https://www.youtube.com/channel/UC5NStd0QmACnWs9DzqJ3vHg/videos
  25. Stairs between two floors?

    Append a polyframe node on your resampled lines, set "Tangent name" to N, set N.y to 0 and copy a box onto these points. stairs_pframe.hipnc