|
|
I have a problem which I need to solve to draw molecules with balls and
wooden sticks.
Each bond is defined as a cylinder whose endpoints are <x1,y1,z1> and
<x2,y2,z2>. Let's say it is of length r, which can be easily calculated,
as can phi and theta in polar space. If I want to apply a wooden texture
to all such bonds in a molecule, I need to orient the texture so that
the wood grain is parallel to the bond.
I think I should make this cylinder, since the grain of the texture is
in the X direction (or the appropriate version for whatever axis the
grain goes in, I don't have the datum in front of me):
cylinder{
<0,0,0>,<r,0,0>, whatever_radius
texture{A_Wood_Texture}
}
How should I get it to the right place and in the right orientation?
--
Heinz Hemken
San Diego, California
Post a reply to this message
|
|
|
|
Heinz Hemken <zot### [at] franchiseloancom> wrote:
: How should I get it to the right place and in the right orientation?
With a matrix transformation. See http://www.erols.com/vansickl/matrix.htm
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
|
|
If you can manage messy code, see my twister.inc I once posted in
p.b.u. (if you can't find it check out the p.b.u. utilities list
posted by Ken in p.a.f-a-q). The solution there was kindly provided by
John VanSickle and Jerry Anning, IIRC.
Peter Popov
ICQ: 15002700
Post a reply to this message
|
|