Jump to content

konstantin magnus

  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won


Everything posted by konstantin magnus

  1. How to export uv texture as an image file?

    Seriously though, to bake point colors onto a UV texture, set a string parameter to your geometry and put these lines into a COP snippet. vector pos_tex = set(X, Y, 0.0); vector geo_clr = uvsample(geo, 'Cd', 'uv', pos_tex); assign(R, G, B, geo_color); baking.hipnc
  2. Join meshes together smooth transition

    Once you have laid out your model properly a mere fuse node will do. Here is a quick attempt to get you started. It still lacks orienting the handle to the holes, though. cup.hipnc
  3. Procedural Graffiti Art

    Let's suppose we want to imitate graffiti art pieces with minimal effort. Warp the lines into curvy curves. Map the direction to the closest curves with greyscale values. Colorize each segment. And e x p l o d e by color difference. curve_art.hipnc
  4. Procedural Graffiti Art

    Also here is a short video tutorial in case you still wonder how it's done:
  5. Procedural Graffiti Art

    And here is a slightly simplified variant for those who prefer using VOPs. curve_art_VOP.hipnc
  6. Wireframe and UV Distortion with mantra

    Hi Helmut, I got fairly good results by distorting colorful circles on top of images/renderings like so: https://forums.odforce.net/topic/44391-na/?tab=comments#comment-208974 To get closer to certain artists' way of painting though you would need to breakdown their visual style first. There won't be the one uber-cartoon shader that covers it all. Hirai Toyokazu also used to present his cartoon shading workflows on CMIVFX. Maybe you can get hold of this: https://web.archive.org/web/20180827020108/https://cmivfx.com/houdini-cartoon-effect
  7. arc from three points (vex)

    Hi Jiri, to get started I just wrote a script that turns a bunch of lines with three points into circles: It's basically calculating the intersection point and radius of rectangular vectors starting from the lines' midpoints. To be run in a primitive wrangle: // 3D INTERSECTION // https://stackoverflow.com/questions/10551555/need-an-algorithm-for-3d-vectors-intersection function vector intersection(vector r1, r2, e1, e2){ float u = dot(e1, e2); float t1 = dot(r2 - r1, e1); float t2 = dot(r2 - r1, e2); float d1 = (t1 - u * t2) / (1 - u * u); float d2 = (t2 - u * t1) / (u * u - 1); vector p1 = r1 + e1 * d1; vector p2 = r2 + e2 * d2; vector pos_center = (p1 + p2) * 0.5; return pos_center; } // INPUT POSITIONS int pt_0 = primpoint(0, i@primnum, 0); int pt_1 = primpoint(0, i@primnum, 1); int pt_2 = primpoint(0, i@primnum, 2); vector pos_A = point(0, 'P', pt_0); vector pos_B = point(0, 'P', pt_1); vector pos_C = point(0, 'P', pt_2); vector mid_AB = (pos_A + pos_B) * 0.5; vector mid_BC = (pos_B + pos_C) * 0.5; // DIRECTIONS vector dir_BA = normalize(pos_B - pos_A); vector dir_BC = normalize(pos_B - pos_C); vector dir_rect = normalize(cross(dir_BA, dir_BC)); vector dir_BA_rect = normalize(cross(dir_BA, dir_rect)); vector dir_BC_rect = normalize(cross(dir_BC, dir_rect)); // ADD CIRCLE vector pos_center = intersection(mid_AB, mid_BC, dir_BA_rect, dir_BC_rect); float radius = distance(pos_center, pos_A); int pt_add = addpoint(0, pos_center); int circle_add = addprim(0, 'circle', pt_add); matrix3 xform_circle = dihedral({0,0,1}, dir_rect); scale(xform_circle, radius); setprimintrinsic(0, 'transform', circle_add, xform_circle); // REMOVE INPUT GEOMETRY removeprim(0, i@primnum, 1); circles_from_points.hipnc
  8. Blinn shader as default for new geos

    You can manipulate the viewport shader by pressing the 'D' key with your cursor on the viewport. In the "material" tab you will find the typical settings.
  9. Procedural Rose

    Hi Zunder, I think the second video you have posted shows almost the entire process: He is basically deforming a spiraling grid.. flower.hipnc
  10. Blinn shader as default for new geos

    Hi Andy, if you don't get an answer here, it's mostly because you did not specify your question sufficiently.
  11. Join & simplify geo made of multiple boxes

    In order to turn voxel fields into cubic meshes first make sure their interior is filled. Then set the VBD visualize tree node to 'Active Voxels' -> ''Solid Boxes'. Then again use boolean union and dissolve inner edges. voxel_mesh.hipnc
  12. how to paint points direction while sliding on surface

    Hi Nicola, @moedeldiho from Entagma recently published a tutorial about moving points along gradients: https://entagma.com/obstacle-avoidance-flow-fields/ I quickly turned it into a 3D variant, although I am pretty sure this could also be done within volumes or POPs. tears.hipnc
  13. selecting acute points by angle threshold

    Hi Felix, first you would iterate over all neighbours() with foreach(), adding all dot products of the point's and the neighbors' normals. Then you divide this sum by the number of its neighbors. // INPUT float thresh = chf('threshold'); // PROCESS float d = 0.0; int nbs[] = neighbours(0, i@ptnum); foreach(int nb; nbs){ vector nml_nb = point(0, 'N', nb); d += dot(v@N, nml_nb); } d /= len(nbs); // OUTPUT f@acuteness = d; i@group_acute = thresh > d; v@Cd = hsvtorgb(set(1.0 - d,1,1)); There is a a bit on curvature and the likes in the documentation about the new measure SOP: https://www.sidefx.com/docs/houdini/nodes/sop/measure.html acuteness.hipnc
  14. Solid flat colors and no AA

    If you need the result in SOPs it's probably more performant and convenient to just stay in SOPs. So you would move the tracing procedure from the COP's canvas to a SOP's grid and use findattribval() to check which primitives have been hit, like so: SOP_trace_prim_IDs.hipnc
  15. Solid flat colors and no AA

    To find out if primitives are visible you could simply shoot rays from the center of each primitive towards the camera's position and check whether they get blocked by anything. visible_prims.hipnc
  16. Wireframe and UV Distortion with mantra

    Hi Helmut, do you mean artistic wireframe edges or the outer rim of the entire mesh? Either way, if you are talking about turning the wireframe into something more complex you could always color ramp the distance values and/or distort them with some noise: wireframe_art.hipnc In case you meant the entire mesh, you can color ramp a lambert shader like this: Also, a more painterly look can be achieved by using images to control gradient thresholds: https://www.sidefx.com/forum/topic/68331/
  17. Solid flat colors and no AA

    There you go: Aliased object IDs in COPs. // CAMERA float aspect_cam = YRES / float(XRES); vector pos_canvas = set(X - 0.5, (Y - 0.5) * aspect_cam, 0.0) * 0.036; matrix xform_cam = optransform(cam); vector pos_cam = cracktransform(0,0,0,0,0, xform_cam); vector pos_sensor = pos_canvas * xform_cam; vector pos_focal = set(0.0, 0.0, focal) * xform_cam; vector dir_sensor = normalize(pos_sensor - pos_focal); vector ray_sensor = dir_sensor * vector(range_cam); // TEXTURE vector pos_hit; vector st_hit; int prim_hit = intersect(geo, pos_sensor, ray_sensor, pos_hit, st_hit); int id = prim(geo, 'id', prim_hit); // OUTPUT vector color = rand(id); assign(R, G, B, color); COP_render_ID.hipnc
  18. Solid flat colors and no AA

    Hi cyhiso, my custom-made raytracer supports true non-anti-aliasing ; ) Just create a unique attribute value for each object and render it.
  19. Wireframe and UV Distortion with mantra

    I have recorded a short tutorial explaining this method a little:
  20. Removing Points on corners

    You can identify corner points on flat polygons by their tangents' length between two edges using the polyframe node. corners.hipnc
  21. Select color precisly from @Cd (keying, vex, RGB)

    Hi Dorian, have you tried the cluster points-SOP yet?
  22. Ground, ground, ground, ... and ground again

    There are various ways to avoid / reduce tiling: using procedural shaders blending various textures texture bombing
  23. Ground, ground, ground, ... and ground again

    Hi Mani, a common way to increase surface details on terrains is to use displacement maps on regular quad meshes. Texture haven and HDRI haven are good places for getting free texture sets without registration: https://texturehaven.com/ https://hdrihaven.com/ terrain_tex.hipnc
  24. modeling a cell (beginner)

    Hi Daniel, that's a complex shape which will require a fair amount of RnD. But to get started you could delete the top of a spherified cube and deform it with noise. The finer surface structures would probably be done with displacement textures. cell.hipnc