Houdini and analytical geometry

   5564   7   0
User Avatar
Member
512 posts
Joined: July 2009
Offline
hi there,

is it possible to create an equilateral triangle with expressions and calculate it's center point? I read there is this hou.hmath module, unfortunately I have no idea of the VEX script language :?

best regards,

Manuel
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
512 posts
Joined: July 2009
Offline
creating a circle and reducing its divisions does the trick.
Although i would have like control over angles and side length of the triangle.
Is such a thing possible?
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
1909 posts
Joined: Nov. 2006
Offline
Wouldn't having control over the angles make it a non-equilateral triangle?

It's easy to setup a system so you can control the length of the sides for an equilateral triangle using the good old Law of Sines.

Since the triangle is equilateral, you know the central angle to each side is 120 degrees, forming an isosceles triangle with 2 angles each 30 degrees. You know the outer side, which is the value you want, so you just need to solve for r.

sin A/r = sin B/b

r = (sin(30) * desired length / sin(120))

Example attached.

Attachments:
triangle_law_of_sines.hipnc (39.2 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
512 posts
Joined: July 2009
Offline
much obliged, Graham!

that helps a lot!!! :wink:

greetings

Manuel
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
1909 posts
Joined: Nov. 2006
Offline
Since I just love math I reimplemented it all using just an Add sop to create everything Also added a slider to rotate the triangle.

Attachments:
triangle_trig.hipnc (45.6 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
1909 posts
Joined: Nov. 2006
Offline
And since I have nothing better to do during the intermission of the hockey game, here's the one using the Circle SOP but modified so that it can create not just a triangle, but any n-gon with controllable side length.

Attachments:
ngon_trig.hipnc (47.4 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
7764 posts
Joined: July 2005
Offline
Call me a Rational Trig [en.wikipedia.org] convert, so no sin for me.

Attachments:
eq_triangle.hipnc (51.9 KB)

User Avatar
Member
512 posts
Joined: July 2009
Offline
awesome !!!

You guys seem to have fun xD
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
  • Quick Links