POV-Ray : Newsgroups : povray.newusers : Combining thousands of smooth_triangles into an object : Re: Combining thousands of smooth_triangles into an object Server Time
29 Jul 2024 06:25:03 EDT (-0400)
  Re: Combining thousands of smooth_triangles into an object  
From: Chris B
Date: 23 May 2006 14:57:08
Message: <44735b04@news.povray.org>
"Nigo" <hej### [at] hotmailcom> wrote in message 
news:web.44734e3cef466b7415265f240@news.povray.org...
> Hi there
>
> I'm trying to generate a picture with two proteins (two seperate *.pov and
> *.inc files) obtained from swiss pdb-viewer.
>
> The proteinstructures are defined by thousands of smooth_triangles in the
> form
> ... snip ...
> ..... but they are not defined as an object, so I can't use a
> transform/translate command to position them. If I include both proteins 
> in
> the same pov-file they will be positioned on top of each other, which is 
> not
> pretty ;-)
>
> I've tried enclosing each protein in a mesh with:
> #declare A0_shape=mesh{
> all the smooth_triangles...
> }
>
> but it doesn't work :-( How do I enclose each protein in it own object so 
> I
> can position them relative to each other?
>
> Best regards,
> Nigo
>

Hi Nigo,

According to the documentation, this form of texture definition isn't 
supported by the mesh object, which requires textures to be declared before 
using them in this context.
A simple workaround is to declare the object as a union of the individual 
smooth triangles whereupon it doesn't complain about the inline texture 
definition. (see the following example)

Where you said "but it doesn't work". It would have been better if you'd 
have listed the error message as the problem would have been quicker to 
diagnose.

Regards,
Chris B.


camera {location <0,0,-2> look_at 0}
light_source { <0, 50, 0> color 1}

#declare RIBBON_FINISH = finish {phong 0.5}
#declare MyShape = union {
  smooth_triangle
 
{<19.880,-14.362,-31.678><-0.568,0.536,-0.625>,<19.909,-14.498,-31.821><-0.568,0.536,-0.625>,<19.999,-14.413,-31.830><-
  0.568,0.536,-0.625>texture{pigment{
  colour red 1.00 green 1.00 blue 1.00} finish{ RIBBON_FINISH }}}
  smooth_triangle
 
{<19.880,-14.362,-31.678><-0.568,0.536,-0.625>,<19.999,-14.413,-31.830><-0.568,0.536,-0.625>,<20.043,-14.309,-31.780><-
  0.568,0.536,-0.625>texture{pigment{
  colour red 1.00 green 1.00 blue 1.00} finish{ RIBBON_FINISH }}}
}

object {MyMesh translate <-19.880,14.362,31.678> scale 2}


Post a reply to this message

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