To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.rayOpen lugnet.cad.ray in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Ray-Tracing / 686
685  |  687
Subject: 
Re: Is there some pov-ray friendly version of car wash brush part?
Newsgroups: 
lugnet.cad.ray
Date: 
Wed, 3 Jan 2001 16:09:44 GMT
Viewed: 
2377 times
  
In lugnet.cad.ray, Lars C. Hassing wrote:

Does anyone know how to make the matrix for a 4-4cyli.dat
with radius R and endpoints (x1,y1,z1) and (x2,y2,z2) ?

Sorry, I don't have an algorithm or formula handy.

Would the following steps work?  The only 'magic' bit (for me) is finding a
vector normal to two other vectors.  That should be doable, I just don't
know how to do it.

Take endpoints P1 <x1,y1,z1> and P2 <x2,y2,z2>.
Figure the vector V1 = P2 - P1.
Figure the cylinder's height, H (the length of V1).
Find a vector V2 which is normal to V1 and <0,1,0>
Find the angle T between V1 and <0,1,0>

With this information, you can write LDLite code for the cylinder:

0 TRANSLATE x1 y1 z1
  0 ROTATE T V2
    1 16 0 0 0 R 0 0 0 H 0 0 0 R 4-4cyli.dat
  0 ROTATE END
0 TRANSLATE END

(with a few other lines to define the vectors, or just substitute the
component values for the vectors).

This LDLite code can be translated to DAT code.  If you want the
pseudo-code for doing the translation, let me know, and I'll post it.

Steve



Message is in Reply To:
  Re: Is there some pov-ray friendly version of car wash brush part?  [DAT]
 
Michal Krbec wrote... (...) Unfortunately the 2473 brush uses lines. This is poor design, it should have used cylinders, which will look correctly if you zoom in. Does anyone know how to make the matrix for a 4-4cyli.dat with radius R and endpoints (...) (24 years ago, 24-Dec-00, to lugnet.cad.ray)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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