3rd point on a triangle given lengths and 2 points

Topics concerning ICE & Math
Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: 3rd point on a triangle given lengths and 2 points

Post by Pooby » 16 Oct 2013, 11:50

Would somebody please try doing this in ICE.. I must be totally thick but I cannot work it out even based upon all the clear sounding explanations here.

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: 3rd point on a triangle given lengths and 2 points

Post by Pooby » 16 Oct 2013, 12:11

Daniel Brassard wrote:See it this way .... vector addition

vector A to B (length and direction) add vector B to C (length and direction) will give you vector A to C (length and direction).

Dan
But we dont have the A to B direction or B to C direction, just the length of both and the angle between them. Thats whats confusing me.
What I really want is the angle between A to C and A to B, then I can work the other out easily

just to remind you who you're dealing with here.

https://vimeo.com/20840644

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: 3rd point on a triangle given lengths and 2 points

Post by EricTRocks » 16 Oct 2013, 12:46

I'll try to draw something once I get to work that will hopefully help.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

danyargici
Posts: 56
Joined: 09 Nov 2009, 10:58

Re: 3rd point on a triangle given lengths and 2 points

Post by danyargici » 16 Oct 2013, 15:30

Pooby wrote: But we dont have the A to B direction or B to C direction, just the length of both and the angle between them. Thats whats confusing me.
What I really want is the angle between A to C and A to B, then I can work the other out easily

just to remind you who you're dealing with here.

https://vimeo.com/20840644
You don't need the direction. Just assume it's any arbitrary axis. Create 2 vectors with the lengths that you know represented in their Y axis. Rotate one around X or Z (in this example) by your angle (that you know). Now add one vector to the other. There is your missing vector, then you can just use a 'Get Angle Between' node.

Hope that helps.

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: 3rd point on a triangle given lengths and 2 points

Post by Daniel Brassard » 16 Oct 2013, 15:47

By Daryl Dunlap

$ifndef "Softimage"
set "Softimage" "true"
$endif

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: 3rd point on a triangle given lengths and 2 points

Post by Bullit » 16 Oct 2013, 23:28

Clipboardb.jpg
These are two points that rotate, now the solution would be to find where in their trajectories they will intersect each other, then that is the third point.
That i didn't found out yet how to do. Maybe spawn a point when that happens and get its position.

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: 3rd point on a triangle given lengths and 2 points

Post by EricTRocks » 17 Oct 2013, 04:40

My solution to finding the first bones rotation, hopefully you can see the correlation between the colors of the objects and the ICE Tree.

Image

Image

Once you find that rotation, you set the rotation of the first bone. The position of the first bone is the same position as the root objects position. Then you create a vector that is the same length as the first bone and rotate it by the first bone rotation angle which gives you the position of the second bone.

To find the rotation of the second bone you can cheat and use the direction to rotation node in ICE and plug in the subtraction of the effector position from the second bone position. I have another way of finding that angle if you want me to post it.

The final thing you'll need to do is to get all of that transforming by a transform that is looking at the effector and stabilized by an up vector object. Basically create a "direction constraint" which will give you a transform which you then multiply the first bone and second bone transforms by.

Hope this helps.

Eric T.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: 3rd point on a triangle given lengths and 2 points

Post by Bullit » 17 Oct 2013, 07:37

A further advance but only by aproximation. Where points intersect is the 3rd point.

I emit the particles from another ice tree with pointpositionC data. The point ID isn't doing anything since the logic as is isn't enough.
Clipboardc.jpg
This probably needs to be made with trignometry. Or maybe if there is a way to use strands or curve and get their intersection point.

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: 3rd point on a triangle given lengths and 2 points

Post by Pooby » 17 Oct 2013, 10:57

EricTRocks wrote:My solution to finding the first bones rotation, hopefully you can see the correlation between the colors of the objects and the ICE Tree.



Once you find that rotation, you set the rotation of the first bone. The position of the first bone is the same position as the root objects position. Then you create a vector that is the same length as the first bone and rotate it by the first bone rotation angle which gives you the position of the second bone.

To find the rotation of the second bone you can cheat and use the direction to rotation node in ICE and plug in the subtraction of the effector position from the second bone position. I have another way of finding that angle if you want me to post it.

The final thing you'll need to do is to get all of that transforming by a transform that is looking at the effector and stabilized by an up vector object. Basically create a "direction constraint" which will give you a transform which you then multiply the first bone and second bone transforms by.

Hope this helps.

Eric T.
That helps a lot.. I did manage to get something that works yesterday, but yours seems a lot more elegant, thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests