-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SplineMeshTiling direction bug #48
Comments
"Direction" may be confusing, as this vector is really the control point of the curve, in Cubic Bezier Curve vocabulary. This mean the actual direction vector is the vector going from Position to Direction. Therefore, if you have the same value in Position and Direction, there is no direction at all and the result will be wrong. Note that the vector [Direction - Position] gives the direction of the curve, and its magnitude gives the strength of the curvature. |
Thank you very much for your reply. |
If you want to have a straight line as a bezier curve, you will at least
need to set a direction from the node "n" to the node "n+1". The length of
the vector won't be relevant as there is no curvature, but will at least
need to be smaller than half the distance between the node to avoid the
curve going back and forth on the line.
Typically :
Node 1
Position 0, 0, 0
Direction 0.01, 0, 0
Node 2
Position 1, 0, 0
Direction 1.01, 0, 0
In Pseudo code, you could have
node1.Direction = node1.Position + (node2.Position - node1.position).normalized * 0.01f;
node2.Direction = node2.position + (node2.Position - node1.position).normalized * 0.01f;
Please note that in SplineMesh, the forward and backward directions at a
single node are always mirrored, and SplineNode.Direction represents the
forward direction in the spline space. It's a limitation of the asset.
Le lun. 9 août 2021 à 17:49, programming2012 ***@***.***> a
écrit :
… "Direction" may be confusing, as this vector is really the control point
of the curve, in Cubic Bezier Curve vocabulary. This mean the actual
direction vector is the vector going from Position to Direction. Therefore,
if you have the same value in Position and Direction, there is no direction
at all and the result will be wrong.
Note that the vector [Direction - Position] gives the direction of the
curve, and its magnitude gives the strength of the curvature.
Thank you very much for your reply.
In this sample, if the position and direction is same, Can it be
understood that this is not a Bezier Curve, but a Line segment. From the
point of view of code implementation, is this feasible? Just like I have a
telephone pole, it is vertical, like a line segment.
Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#48 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5QKTWE3LYUE6CNU2XEQSTT372G7ANCNFSM5B2DJTCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Thank you very much |
Hi
I am using SplineMeshTiling.
There are two nodes on Spline. The fields of Element 0 are: Position(0,0,0), Direction(0,0,0). The flelds of Element 1 are: Position(0,-10,0), Direction(0,-10,0).
And then i add Mesh and Material to SplineMeshTiling. You can see something wrong on the Element 0.
If you set Direction of Element 0 to (0,-1,0). The Mesh rendering is correct.
Thanks.
The text was updated successfully, but these errors were encountered: