Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

Connected Lines in Ventuz

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
kberraho
Posts: 54
Joined: 12 Apr 2016, 16:01

Connected Lines in Ventuz

Post by kberraho » 12 Apr 2016, 16:22

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

hummerbaendiger
Posts: 21
Joined: 22 Mar 2012, 15:54

Re: Connected Lines in Ventuz

Post by hummerbaendiger » 03 May 2016, 10:07

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.

User avatar
ErikB
Posts: 212
Joined: 10 Jan 2012, 12:52

Re: Connected Lines in Ventuz

Post by ErikB » 03 May 2016, 10:20

Hey, common request and definitely on our to-do list of effects... no firm timeline yet though.

kberraho
Posts: 54
Joined: 12 Apr 2016, 16:01

Re: Connected Lines in Ventuz

Post by kberraho » 03 May 2016, 20:22

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

kberraho
Posts: 54
Joined: 12 Apr 2016, 16:01

Re: Connected Lines in Ventuz

Post by kberraho » 03 May 2016, 20:26

Check out this http://www.mathopenref.com/arctan.html
Example to prove the concept.

kberraho
Posts: 54
Joined: 12 Apr 2016, 16:01

Re: Connected Lines in Ventuz

Post by kberraho » 05 May 2016, 21:07

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.
Attachments
SS_dynamic_points.png
SS_dynamic_points2.png

T_Gabrielsen
Posts: 2
Joined: 10 Aug 2017, 13:27

Re: Connected Lines in Ventuz

Post by T_Gabrielsen » 10 Aug 2017, 13:34

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!

T_Gabrielsen
Posts: 2
Joined: 10 Aug 2017, 13:27

Re: Connected Lines in Ventuz

Post by T_Gabrielsen » 11 Aug 2017, 06:35

After a lot of trial & error i finally got it working.
Attachments
Bildschirmfoto 2017-08-11 um 07.23.00.png
Bildschirmfoto 2017-08-11 um 07.21.53.png
lines_comp.vza
(12.96 KiB) Downloaded 226 times

Post Reply