Search - User list
Full Version: vangle?
Root » Technical Discussion » vangle?
Phillip
Hi I'm trying to find an anle between two vectors using the vangle.
Before I continue heres a quick question:

Is there anywhere in houdini where you can test an expression, besides just dropping it into the expression editor. Is there something like the textport where I can type expressions Im trying out?

So I have two vectors: A and B
A is parralel to the x axis so A=vector3(1,0,0) …right???
and B at a 45 degree angle - so: B=vector3(1,1,0) …right too???
now using vangle(A,B) I get 0 returned …should I not get 45?

What Im I doing wrong?

Pleeeze help…I tried normalize A and normalize B as well but arnt they already normalized here?
EigenAlex
Hi phillip,

I think that your expression is just fine. I tested the vangle() with what you have typed, it returned 45 degree.

In textport, all you need is just echo the value back. Something like:

echo `vangle(vector3(1,0,0), vector3(1,1,0))`

Cheers,
Alex
Phillip
I got it to work….

You need to specify all your data types.
I had missed one, so Houdini, I guess by default, set my value to an integer - which meant that I either got a 0 or 90 back. I put float in befire my var, and everthing works great now.

Thanks anyways Alex - I appreciate your quick response
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB