POV-Ray : Newsgroups : povray.general : smooth_triangle works outside but not inside objects Server Time
7 Aug 2024 01:25:43 EDT (-0400)
  smooth_triangle works outside but not inside objects (Message 1 to 2 of 2)  
From: David Mathog
Subject: smooth_triangle works outside but not inside objects
Date: 21 Nov 2001 10:50:00
Message: <3BFBCD27.39594F86@caltech.edu>
SPDBV is a molecular viewing program that generates POV3 scenes.  For
solids the .inc
file contains a series of lines like (this will probably wrap in the
post):

smooth_triangle
{<14.291,11.967,-11.578><-0.631,-0.679,0.374>,<14.482,11.811,-11.538><-0.631,-0.679,0.374>,<14.400,11.560,-12.132><-0.631,-0.679,0.374>texture{pigment{
colour red 0.80 green 0.80 blue 0.80} finish{ RIBBON_FINISH }}}

These are not inside any object.  The .pov/.inc file will render
correctly.  If I then enclose
this series of smooth_triangle commands like this:

#declare R1_shape=mesh{
smooth_triangle...
smooth_triangle...
}
object{ R1_shape }   // Ribbon 1

it will no longer render, generating instead the error:

Parsing..................................// ------- Accessible Dot Surf.
--------

//---- Ribbon ----
#declare R1_shape=mesh{
smooth_triangle
{<14.291,11.967,-11.578><-0.631,-0.679,0.374>,<14.482,11.811,-11.538><-0.631,-0.679,0.374>,<14.400,11.560,-12.132><-0.631,-0.679,0.374>texture{pigment
<----ERROR

bad.inc:2484: error: texture identifier expected but pigment found
instead.
(with:  Persistence of Vision(tm) Ray Tracer Version 3.1g.Linux.ccc,
running on Alpha.)

Why does this occur?  How come a smooth_triangle in one form works
outside an object, but not inside one???

So far I've been able to work around it by using:

#declare DRMT1=texture{pigment{ colour red 0.80 green 0.80 blue 0.80}
finish{ RIBBON_FINISH }}
#declare R1_shape=mesh{
smooth_triangle
{<14.291,11.967,-11.578><-0.631,-0.679,0.374>,<14.482,11.811,-11.538><-0.631,-0.679,0.374>,<14.400,11.560,-12.132><-0.631,-0.679,0.374>texture{
DRMT1 }}
etc.
}
object{ R1_shape }   // Ribbon 1

but that's not a good general solution if there are a lot of textures.


Thanks,

David Mathog
mat### [at] caltechedu
Manager, Sequence Analysis Facility, Biology Division, Caltech


Post a reply to this message

From: Ken
Subject: Re: smooth_triangle works outside but not inside objects
Date: 21 Nov 2001 20:46:28
Message: <3BFC594C.1A551BCD@pacbell.net>
David Mathog wrote:
> 
> SPDBV is a molecular viewing program that generates POV3 scenes.  For
> solids the .inc
> file contains a series of lines like (this will probably wrap in the
> post):

> These are not inside any object.  The .pov/.inc file will render
> correctly.  If I then enclose
> this series of smooth_triangle commands like this:

> bad.inc:2484: error: texture identifier expected but pigment found
> instead.
> (with:  Persistence of Vision(tm) Ray Tracer Version 3.1g.Linux.ccc,
> running on Alpha.)
> 
> Why does this occur?  How come a smooth_triangle in one form works
> outside an object, but not inside one???
> 
> So far I've been able to work around it by using:
> 
> #declare DRMT1=texture{pigment{ colour red 0.80 green 0.80 blue 0.80}
> finish{ RIBBON_FINISH }}
> #declare R1_shape=mesh{
> smooth_triangle
>
{<14.291,11.967,-11.578><-0.631,-0.679,0.374>,<14.482,11.811,-11.538><-0.631,-0.679,0.374>,<14.400,11.560,-12.132><-0.631,-0.679,0.374>texture{
> DRMT1 }}
> etc.
> }
> object{ R1_shape }   // Ribbon 1
> 
> but that's not a good general solution if there are a lot of textures.

Unfortunately that is the only way to individually texture individual
triangles inside a mesh object. You can try a union instead but unions
are not as efficient as meshes if you need multiple copies of the same
object. However, if you don't need multiple copies....

-- 
Ken Tyler


Post a reply to this message

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