Jump to content

Librarian

Members
  • Content count

    1,379
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won

    93

Librarian last won the day on September 17

Librarian had the most liked content!

Community Reputation

709 Excellent

About Librarian

  • Rank
    Grand Master
  • Birthday 03/04/1976

Contact Methods

  • Website URL
    https://gumroad.com/houd

Personal Information

  • Name
    Tesan Srdjan
  • Location
    Göteborg/Sarajevo

Recent Profile Visitors

14,641 profile views
  1. VDB Curvature Flow

    /* 1. Create normal for input points. 2. Cross product of N and a tangent "z-vector", rotate this by X degrees. Z-vector points in inclination dir. 3. Create a new point by pushing it along the generated direction for dist_factor. 4. Move the new point to the surface and connect to the previous point. 5. Create attributes. 6. Repeat. */ float dist_factor = ch("dist_factor"); float rotation_degrees = ch("degrees"); float per_step_rotation = ch("per_step_rot"); int steps = chi("steps"); float pc_radius = ch("pc_radius"); int diagonal = chi("diagonal"); vector find_z_vec(vector pos; float pcrad; int diagonal) { int handle = pcopen(1, "P", pos, pcrad, 1); if (pciterate(handle)) { int found_pt; vector found_pos; pcimport(handle, "point.number", found_pt); pcimport(handle, "P", found_pos); int neighbors[] = neighbours(1, found_pt); int n_neighbor_arr[]; int cross_neighbors[]; vector max_y_pos = set(0, -1000, 0); foreach (int n_pt; neighbors){ vector n_pos = point(1, "P", n_pt); if (n_pos.y > max_y_pos.y) { max_y_pos = n_pos; } if (diagonal){ int a_neighbors[] = neighbours(1, n_pt); foreach(int a_pt; a_neighbors){ append(n_neighbor_arr, a_pt); } } } // Activating diagonal also checks the diagonal neighbors for a maximum y value if (diagonal) { foreach(int m_index; int m_pt; n_neighbor_arr){ foreach(int k_index; int k_pt; n_neighbor_arr){ if (k_index > m_index && m_pt == k_pt && m_pt != found_pt){ append(cross_neighbors, m_pt); } } } foreach(int cross_pt; cross_neighbors){ vector n_pos = point(1, "P", cross_pt); if (n_pos.y > max_y_pos.y){ max_y_pos = n_pos; } } } pcclose(handle); return normalize(found_pos - max_y_pos); } else { return set(0, 0, 0); } } int old_pt, new_pt = @ptnum, prim; vector curr_normal = @N; vector curr_pos = @P; for (int i = 0; i < steps; ++i){ // find the tangent vector zvec = find_z_vec(curr_pos, pc_radius, diagonal); if (length(zvec) == 0.0) //no max value found => no point on the surface found break; // basic translation of the point vector pre_rot_vec = cross(curr_normal, zvec); vector4 quat = quaternion(radians(rotation_degrees + per_step_rotation * i), curr_normal); vector rotated = normalize(qrotate(quat, pre_rot_vec)); curr_pos = curr_pos + dist_factor * rotated; // this pushes the point to the surface vector gradient = volumegradient(2, 0, curr_pos); float sample = volumesample(2, 0, curr_pos); curr_pos += normalize(-gradient) * sample; curr_normal = normalize(-gradient); old_pt = new_pt; new_pt = addpoint(geoself(), curr_pos); // set attributes and create a spline, grad attribute is used for the color ramp setpointattrib(geoself(), "N", new_pt, curr_normal, "set"); setpointattrib(geoself(), "grad", new_pt, i / (float) steps, "set"); prim = addprim(geoself(), "polyline"); addvertex(geoself(), prim, old_pt); addvertex(geoself(), prim, new_pt); }
  2. Adobe Illustrator file to Geometry

    @nijhun Just search on GitHub "Baku89 Houdini NOPS" he posted wonderful things(otls) Have Fun .
  3. very simple lighting question

    have Fun PointCloud2017.hipnc
  4. Hinge constraint

    just open those OTL'S C:/Program Files/Side Effects Software/Houdini 18.5.351/houdini/help/examples/nodes/dop/constraintnetwork/
  5. Reaction Diffision OpenCL - Missing F and K Parameters

    @yasinesin You have if you search "all-ready in- Open cl formulas* in this forum + try using this also. Have Fun OI @yasinesin maybe its reverse in U and V its working here
  6. very simple lighting question

    @gnarlog ...or...Post that scene Please. I have this code Old, just use on that saved points on Mantra In-line Code . $out = 0;//npoints($input); int size = npoints($input); int samples = 800; vector pos[]; resize(pos, size); float cdf[]; for (int i=0; i<npoints($input); i++) { vector Lpos = ptransform("space:world", "space:camera", point($input,"P",i)); pos[i] = Lpos; cdf[i] = 1/distance2(P,Lpos) * max(0 ,dot(normalize(N), normalize(Lpos-P))) + cdf[i-1]; } int getI(float cdf[]; float r) { int i = 0; r*=cdf[-1]; while(r<cdf[i]) i++; return i; } for (int i=0;i<samples;i++){ int id = int(nrandom("qstrat")*size); vector Lpos = pos[id]; $out += vector(point($input,"Cd",id))/distance2(P,Lpos) * max(0, dot(normalize(N), normalize(Lpos-P))); } $out /= samples;
  7. On Growth and Form

    Fun with Chops and feELib..
  8. how to create specific shape from smoke

    @BaleWang Please search on YouTube "Sadjad Rabiee" Houdini. i detail he explain pyro-source and tricks. Have fun.
  9. Consistent quad size when resizing tube

    You have wonderful ex and otl's in that Topic Uv-shapes(any shape to Uv proj )investigate ..Have FUn https://github.com/Fe-Elf/FeELib-for-Houdini
  10. Pillow

    @torwart tricks to investigate .Have Fun vellumP.hiplc
  11. Controled voronoi fracture

    @CESTAINSI Try this File ..and just Fine adjust . Have FUn byline.hiplc
  12. How to cut vegetables with a knife.

    @r_itoh Have Fun ----I like CHOPS Method ----. If you search on YouTube you have Procedural Mrkovka-(Carrot Slicing) endless possibility with chops Method.
  13. ///1 points wrangle float r = rand(@ptnum * chf("randseed")); i@group_sources = r > 0.85; -------------------------------------- /////2 wrangle //group sources int nears[] = nearpoints(0, @P, chf("maxdist")); foreach (int pt; nears) { setpointgroup(0, "nears", pt, 1); }
  14. Orient away from object

    newton's law and try to use this it works function float Kernel(vector r ; float h){ float q = length(r); q /= h; float factor = 1.0f / (PI * h * h * h ); if( q>0 && q<=1){ float right = 1.0f - 1.5f * (q * q) * (1.0f - q/ 2.0f) ; return factor * right; } if(q >1 && q <=2 ) { float left = factor / 4.0f; float right = pow(2.0f - q , 3); return left*right; } if(q>2) { return 0; } return 0; } function vector GradKernel(vector r; float h){ float q = length(r); q /= h; vector dir = normalize(r); float factor = 1.0f / (PI * h * h * h ); vector retgrad = set(0,0,0); if( q<=1){ retgrad = dir * (factor / h) * (-3.0 * q + 2.25f * q*q); } if( q<2){ retgrad = dir * (-0.75f * (factor / h) * pow((2.0f - q),2) ); } return retgrad; } float h = chf("h"); @P.y = Kernel(@P, h); @N = GradKernel(@P, h); NewtonsLaw.hiplc
×