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:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|