To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 5622
5621  |  5623
Subject: 
Re: bend thingie creator.
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 27 Nov 2000 23:55:49 GMT
Viewed: 
1128 times
  
koen wrote:

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?

  Sorry, I explained myself poorly, I divide the curve in segments with
only 2 points each.

  Bezier and Hermite curves are very similar, but I don't use Bezier
curves because the control points are not very user-friendly, I'd rather
have tangents and let the user move them with the mouse.

  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 ? :)

I can calculate the tangent vector too, but just by substracting the current
point from the next point :-) .

  Are you using forward differences to calculate the curve ?

Your solution sounds a lot faster,sturdier and geekier. I think I'm going to
steal this idea if I can figure out how to add this up-vector to my
rotation-matrix.

  Just build the matrix with the vectors you have, here's the code I'm
using:

      M(0,0) = side[0]; M(0,1) = up[0]; M(0,2) = front[0]; M(0,3) = x;
      M(1,0) = side[1]; M(1,1) = up[1]; M(1,2) = front[1]; M(1,3) = y;
      M(2,0) = side[2]; M(2,1) = up[2]; M(2,2) = front[2]; M(2,3) = z;
      M(3,0) = 0.0;     M(3,1) = 0.0;   M(3,2) = 0.0;      M(3,3) = 1.0;

  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. :)

This definitely sounds very cool, makes me wish I could program a lot
better.

  Feel free to help me with LeoCAD if you have some time to spare. :)
I'm uploading a screenshot of my current curve function to
http://gerf.org/~leo/curve.gif

  Next step on my list is to calculate a bounding box and check if the
object created by the curve intersects with a line segment (for mouse
selection).

  Does your program have an option to set the exact size of the hose ?
I'll have to add this sometime.

Leonardo



Message has 1 Reply:
  Re: bend thingie creator.
 
I've now used the upvector and your rotation matrix. Makes things a lot simpler. Thanks a lot for the tips. koen (24 years ago, 8-Dec-00, to lugnet.cad.dev)

Message is in Reply To:
  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)

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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR