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
Hello Ventuzians!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
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!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
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
Moderator: Support
-
- Posts: 21
- Joined: 22 Mar 2012, 15:54
Re: Connected Lines in Ventuz
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.
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
Hey, common request and definitely on our to-do list of effects... no firm timeline yet though.
Re: Connected Lines in Ventuz
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
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
Check out this http://www.mathopenref.com/arctan.html
Example to prove the concept.
Example to prove the concept.
Re: Connected Lines in Ventuz
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.
Note this only happens in the X axis, and not the Y. THANKS.
-
- Posts: 2
- Joined: 10 Aug 2017, 13:27
Re: Connected Lines in Ventuz
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!
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!
-
- Posts: 2
- Joined: 10 Aug 2017, 13:27
Re: Connected Lines in Ventuz
After a lot of trial & error i finally got it working.
- Attachments
-
- lines_comp.vza
- (12.96 KiB) Downloaded 264 times