Jump to content

Spirals???


Adam Ferestad

Recommended Posts

Hey all, I am trying to get a VOP SOP to change a circle into a spiral, but I am having some trouble with a few things. I got the math function into the network for a Logarithmic Spiral from Wolfram Mathworld. I remember learning about doing it in my Calc class, but for some reason, the vex network isn't actually working. I am pretty sure I got the math in there right, but it seems to be calculating it wrong. The functions are supposed to be

x=a*cos(theta)*e^(b*theta)
y=a*sin(theta)*e^(b*theta)
Where a and b are constants, e is the constant and theta is in radians.

I have checked my network a couple times, but maybe someone else can tell me why it is behaving the way it is. There must be something I don't know about the way vex processes information.

This is what I am getting now. (And yes I know I spelled Logarithmic wrong there ><)

post-6857-131618823806_thumb.png

logrithmicSpiral.hipnc

Link to comment
Share on other sites

looks to me like your vop wants to work but is being clipped along the x axis.

on the left that looks like your math crosses into -z,

but on the x axis, when the spiral approaches zero it is stopped from crossing into any negative floats.

that is the reason for the long jump to the points at the far right of your pic.

look for some a bit in your vop sop, specifically for the x coordinates, where you are using a fit maybe or a choice has been made to use positive floats only...

Edited by smaugthewyrm
Link to comment
Share on other sites

I actually think it has something to do with how I am deriving my my angle measurement for theta. I looked at them and I am not getting from 0 to 2π on my measures for the circle I am starting off with. It is spanning from -1.4 to 1.4 or so. I am not sure how to get the angle measure for each point into the function right to get the angle right since the trig vex node only accepts a radian measure instead of a rational one.

This is another time I wish I could afford the CMIVFX videos, because they have one that covers this :-(

Edited by Adam Ferestad
Link to comment
Share on other sites

Figured out how to hack it together... just had to redefine how I was getting my angle measure. Instead of trying to use the points coordinate, I simply did this:

theta = 360/$NPT * $PT

It is working from what I can tell and looks pretty good. I am going to try some of the other, more complicated spirals and see what I can get to work, wish me luck.

logrithmicSpiral.hipnc

Link to comment
Share on other sites

thanks Fabiano, but that isn't exactly what I was looking for, though there are some interesting things in there, I was looking for a way to do some non standard spirals. There are some really cool things I have found as I play and dig through mathworld that I am trying to figure out how to build in Houdini as a structure. Also, your object seems to be dependent on the number of points you have in the mesh, which is something I wanted to have more flexibility on so an artist could control the density of the resulting geometry without losing the shape. I am thinking of getting all of the spiral types I can working and releasing a Digital Asset on my site for free use. I also think that I may do a short tutorial this month on how I got this one working for my site.

Link to comment
Share on other sites

Very interesting method, but what you have is very different from the logarithmic spiral parametric function I posted before. What you have is this

x = a*cos(b*θ*fit($PT from 0 to $NPT-1))*e^(b*θ*fit($PT from 0 to $NPT-1))
y = a*sin(b*θ*fit($PT from 0 to $NPT-1))*e^(b*θ*fit($PT from 0 to $NPT-1))
where a, b and e are all arbitrary variables and θ is measured in radians

The problem is, e is actually a universal constant like π and you are using b as a frequency modulation on your trig functions. Also, I am not sure exactly why you did the fit stuff, but it looks like you were trying to do 360/($NPT-1) * $PT, which is actually easier to do as just that. If you look in the last one I posted you can see how that works. Again, when you see "e^" anywhere in math that means you need to use the exponential vex node, not the power one. Your best bet to avoid confusion when someone is trying to read your stuff if you aren't using the constant e is to pick a different variable representation.

Link to comment
Share on other sites

he-hee , whata mess ! ..

not only that Adam . before misreading the e^ , i even ignored the spiral 's surname ; logarithmic .

thanks for your corrections and clarifications Adam . =)

--

im uploading a more appropriate / corrected version of my first hip , .. as i should do it .

.. logarithmicZpiral_c.hipnc

edit : in this version , changing the number of input 's points , changes the length of the spiral .

.cheers

Edited by zarti
Link to comment
Share on other sites

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