Page 1 of 1

Connected Lines in Ventuz

Posted: 12 Apr 2016, 16:22
by kberraho
Hello,

Does anyone know how to go about creating dynamic Lines between objects in the render view? something similar to the lines between the globe and the text nodes. what i am referring to is what i have included in the image below. Thank you in advance.https://www.behance.net/gallery/Earth-R ... 01/7568679

Re: Connected Lines in Ventuz

Posted: 03 May 2016, 10:07
by hummerbaendiger
I encountered this task several times already - unfortunately there's no out-of-the box option that I'm aware of :(

But there's a way to achieve this using some math skills (in case of 2D Graphics, 3D will follow the same principle - the math behind is just more complex):
- if you have the absolute positions of your origin and end point (two axes in the same hierarchy level without additional transforms in front) you can calculate the transform that is necessary to connect those two points with a simple geometry (rectangle or cylinder, make sure to set their alignment to either bottom or left - depending on the geometry)
- to get the x y z values from your axis you can use the output matrix and apply a vector transform (node) with the vector (0,0,0,1)
- atan2(x1-x2, y1-y2) will give you the rotation of your object
- distance between both points will give you the scaling (that is applied along the direction of your connection)
- connect the line geometry to the origin, apply scaling and rotation

Also possible (but even more complex) is the use of a custom made mesh that is then transformed with a vertex shader using HLSL. You could then use the wireframe rendering to get a similar effect to the sample you posted.

Re: Connected Lines in Ventuz

Posted: 03 May 2016, 10:20
by ErikB
Hey, common request and definitely on our to-do list of effects... no firm timeline yet though.

Re: Connected Lines in Ventuz

Posted: 03 May 2016, 20:22
by kberraho
Thank you very much hummerbaendiger,

I followed your train of thought and seems to make sense all the way until the section where the atan2 is supposed to give you the rotation of your object.
Just to make sure I am on the same page as you are, when you mean atan2 you mean the inverse of the tangent?
what node am i supposed to use on this step? I tried the float expression node. with this expression Math.Atan(x1-x2, y1-y2)

So far this is what i have in my scene,

Axis1(0,0,0)>>>>Circle node with a size (0.5,0.5)>>>>Axis2(5,5,0)>>>>Circle node with a size (0.5,0.5).>>>>Get world
Axis3(0,0,0)>>>>Rectangular with size (0.05,6.5)

in the Content window i hooked up the Get world to a Vector Transform node.
Axis1 and Axis2 are both hooked to the Float Expression node to compute the angle.

Any assistance would be much appreciate it. Thank you

Re: Connected Lines in Ventuz

Posted: 03 May 2016, 20:26
by kberraho
Check out this http://www.mathopenref.com/arctan.html
Example to prove the concept.

Re: Connected Lines in Ventuz

Posted: 05 May 2016, 21:07
by kberraho
So here is what I have so far, if you see in the picture, I have accomplished the look I was after thanks to the Ventuz community, what you see in the picture are random points A,B and C, every point moves randomly in space on a 2D level, and they are all connected with theses lines in between, the only bug i have is that whenever the A B or C cross on the X axis the alignment changes from left to right giving it a wrong alignment,

Note this only happens in the X axis, and not the Y. THANKS.

Re: Connected Lines in Ventuz

Posted: 10 Aug 2017, 13:34
by T_Gabrielsen
Hi everyone,

i tried to follow the instructions, but i can't get this working.
Can anyone upload a example Scene with two movin dots which are connected through a single line?

Thanks in advance!

Re: Connected Lines in Ventuz

Posted: 11 Aug 2017, 06:35
by T_Gabrielsen
After a lot of trial & error i finally got it working.