POV-Ray : Newsgroups : povray.advanced-users : Translate texture to a cylinder : Translate texture to a cylinder Server Time
30 Jul 2024 14:29:02 EDT (-0400)
  Translate texture to a cylinder  
From: Heinz Hemken
Date: 3 Jun 1999 01:48:50
Message: <37560966.5D952952@franchiseloan.com>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.