Subject:
|
Re: bend thingie creator.
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Sun, 26 Nov 2000 21:09:37 GMT
|
Viewed:
|
947 times
|
| |
| |
koen wrote:
>
> I'm using a simplified form of bezier curves, like you see in most drawing
> software like coreldraw etc..
> this is also x = f(t), y = g(t) and z = h(t) with f, g and h being a*t^3 +
> b*t^2 +c*t + d . a, b , c and d can than simply be calculated with the given
> coordinates. This is a correct third degree approximation but I'm hoping to
> later go to 4th degree or higher approximations.
I've thought about using bezier curves but I decided to choose another
type of curve because it doesn't allow you to make the curve pass by a
specific point (except the first and last points).
> This was the problem with the release in my first posting (i think you mean
> this), My rotation matrix based solely on the direction of the next segment
> did provide with continous segments but it sometines turned 180° because it
> switched to a different quadrant. I now have added another parameter with
> which i can turn the segment around the direction. Now i Make the segment in
> the correct direction , i calculate the distance between a point from the
> previous segment and the current, turn it one degree to left and one to the
> right, if the distance for one of these two turns is lower than the normal
> distance i keep on turning that way until the distance is past its minimum.
> than these two points are the closest together and my curve doesn't have any
> strange twists.
I'm using a different solution: I start with a given up vector for the
first point and then at each point I calculate the tangent vector (first
derivative) and make "side_vector = front_vector x up_vector; up = side
x front;" ('x' means cross product) to get the new up vector. Probably
not the ideal solution too but it's calculated only once and the results
stored in a display list so who cares ? :)
It works very well for my case because when you add a new element, you
always start with a hose along the X axis and the initial up vector is
(0,0,1). When you move the tangents of the endpoints, you just have to
recalculate the initial up vector.
I also added an option to set the axial rotation at each point so you
can see the elements twisting, looks very nice on an animation. :)
Leonardo
|
|
Message has 1 Reply: | | Re: bend thingie creator.
|
| (...) Doesn't this complicate things a lot? It is possible easily draw a hundred beziercurves that make up 1 curve, but how do you make 1 equation that passes through a hundred points? (...) mean (...) segment (...) it (...) with (...) segment in (...) (24 years ago, 26-Nov-00, to lugnet.cad.dev)
|
Message is in Reply To:
| | Re: bend thingie creator.
|
| (...) I'm using a simplified form of bezier curves, like you see in most drawing software like coreldraw etc.. this is also x = f(t), y = g(t) and z = h(t) with f, g and h being a*t^3 + b*t^2 +c*t + d . a, b , c and d can than simply be calculated (...) (24 years ago, 26-Nov-00, to lugnet.cad.dev)
|
14 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|