POV-Ray : Newsgroups : povray.advanced-users : Translate texture to a cylinder Server Time
4 Nov 2024 19:20:03 EST (-0500)
  Translate texture to a cylinder (Message 1 to 4 of 4)  
From: Heinz Hemken
Subject: Translate texture to a cylinder
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

From: Nieminen Mika
Subject: Re: Translate texture to a cylinder
Date: 3 Jun 1999 04:23:11
Message: <37562d5f.0@news.povray.org>
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

From: Peter Popov
Subject: Re: Translate texture to a cylinder
Date: 3 Jun 1999 17:48:58
Message: <3756e941.14244778@news.povray.org>
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

From: Heinz Hemken
Subject: Re: Translate texture to a cylinder
Date: 3 Jun 1999 21:54:46
Message: <375723EC.AF52932C@franchiseloan.com>
Thanks for the tips, I'll try them out!

-- 
Heinz Hemken
IFC Capital Corporation
San Diego, California


Post a reply to this message

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