Jump to content

RobiDoes3d

Members
  • Content count

    4
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Community Reputation

2 Neutral

About RobiDoes3d

  • Rank
    Peon
  • Birthday 12/23/1997

Personal Information

  • Name
    Robert Buzuk
  • Location
    Germany, Offenbach, Bieberer Straße 62
  • Interests
    Working out, terrariums, linear algebra, L-systems
  1. Hscript importing conundrum

    Update: I found out that it doesn't work because the lines get executed one after the other and the wrangle never gets the time to finish cooking. The fix to this is either to split it in two scripts (one containing the first two lines and the other containing the third). I wish there was another way but i think there isn't.
  2. link two points with a curve in vex

    Hi, Yes there is a way. Here is the hip file, the HDA and a bit of mansplaining. Since you want to make a 2D curve it's best to start by defining the plane on which the curve can exist. That will be the a combination of two vector 1.) The one that goes from pt1 to pt2 (lets refer to it as our x-axis) and 2.) The one that goes perpendicularly away from the geo (we will reffer to this one as y). The x-axis will simply be a subtraction of the two @P vectors, cause if you subtract two vectors you get a vector that starts from one and ends on the other. The y-axis can be any vector that has a right angle on the x-axis. But for our purposes we want the curve to get away from the geo, so we can just use the points @N vector, they are pretty perpendicular. Now this is important, we will use linear combination to get the vector into the right place and then we will addpoint and addprim as many times as there are divisions. Linear combination is any formula that can be written like this: a*x + b*y = w where x,y and w are vectors and a and b are scalars. So basically it says you got these two vector, move 'a' amount of time in the vector 'x' direction and then move 'b' amount of times in vector 'y' direction, then you'll arrive at 'w'. Now, if our curve has 4 segments, that means we have to make 4 steps towards it and the length of the step is 1/4. So our 'a' is step length. When we get to our first point (a*x) we are a quarter of the way there and we look up in our ramp that 0.25 means we should be heading some amount in y direction (lets say whooping 5 units ). So our first vector is at w = 1/4*x + 5*y Hope this helps, don't hesitate to ask if something needs asking The hda uses a icon made by Vincent Thomas //Points to connect and their main attributes int Pt1 = chi("Point_1"); int Pt2 = chi("Point_2"); vector Pt1pos = point(0,"P",Pt1); vector Pt2pos = point(0,"P",Pt2); vector Pt1nor = point(0,"N",Pt1); vector Pt2nor = point(0,"N",Pt2); //If we want the curve to be in a flat xy axis then we need to tell it what the axis will be //Heading will be our x and up will be our y //The resulting curve will be a linnear combination of these two axis. vector heading = Pt2pos - Pt1pos; vector up = (Pt1nor+Pt2nor)/2; float mult = chf("Multyplier"); int div = chi("Segments"); float step = 1.0/div; int start=-1 , end=-1; for(int i=0 ; i<div+1 ; i++){ start = end; //This one line directly below shadows a previus statment //with this one, the line wont be flat but a smooth transition from one normal to the other up = (Pt1nor*(1-step*i) + Pt2nor*step*i)/2; up = normalize(up)*mult; float upValue = chramp("Curve", step*i); vector new = Pt1pos + heading*step*i + up*upValue; end = addpoint(0,new); if(i != 0){ int segment = addprim(0,"polyline",start,end); setprimgroup(0,"line",segment,1,"set"); } } ForDavid.hipnc Robert_point_connector.hdanc
  3. Hscript importing conundrum

    Hi, my custom script is very simple : start the vexprofile , cook the snippet that holds my vex , stop the vexprofiler and show me the results. If i copy paste every line into the texport myself the code works. Howerver if I import the .cmd file holding the same three lines it shows me a empty vexprofiler. Doesn't importing .cmd files equal to writing them your self? If not is there something else that has this functionality? Why isn't this working? vexprofile start opcook -F /obj/L_System_v2/L-system/attribvop1/snippet1 vexprofile
  4. VEX problem - for s in string

    Hi, this seems a lot like the problem L-systems are used to. this is my take on this subject: Strings in Houdini have a index property, so if a string is: word="Hello" then word[3]="l" Also you can find out the length of a string by strlen(), It's one of the rare string functions in vex. A cheap way to do something from a user string input would be this: string word=chs("Axiom"); for(int l=0 ; l<strlen(word) ; l++){ if(word[l]==F) doSomething(); if(word[l]==B && word[l+1]==t) doSomethingElse(); if(word[l]==B && word[l+1]==g) doSomethingElse(); }
×