POV-Ray : Newsgroups : povray.newusers : Need help with object pattern syntax... Server Time
26 Nov 2024 17:43:23 EST (-0500)
  Need help with object pattern syntax... (Message 1 to 5 of 5)  
From: Carl Hoff
Subject: Need help with object pattern syntax...
Date: 4 Mar 2004 01:00:49
Message: <4046c611@news.povray.org>
Check out the image I just posted here:

http://www.tron-sector.com/forums/default.aspx?do=top&id=274417

to see the direction this is going.

I've got this coded so I can animate the trail and I need to add the fixed
lines of white that will be added as the bike moves along its path at
regular intervals.  I thought something like this would work and cause
where ever the trail passed through one of the fixes cylinders to be
assigned the texture "bright_white" and use the complicated moving
spherical texture map to be used outside the cylinders.  The example I
was copying was a pigment object pattern.  Can the same effect be used
on textures?  If so do I just have a syntax problem below.  The variable
clock1 below will be replaced with clock in the final animation.  I've just
renamed it so I could manually assign it for making quick test renders.

Can anyone help?
Carl

object {path1_light_trail
  texture {
    object {
      union {
        cylinder {path1_spline(0.15), path1_spline(0.15)+231*y, 20}
        cylinder {path1_spline(0.35), path1_spline(0.35)+231*y, 20}
        cylinder {path1_spline(0.55), path1_spline(0.55)+231*y, 20}
        cylinder {path1_spline(0.75), path1_spline(0.75)+231*y, 20}
        cylinder {path1_spline(0.95), path1_spline(0.95)+231*y, 20}
      }
      texture {bright_white}
    }
    spherical
    texture_map {
      [0    pigment{Red}]
      [0.05 pigment{Red}]
      [0.05 bright_white11]
      [0.10 pigment{Red}]
      [0.10 bright_white10]
      [0.15 bright_white11]
      [0.15 bright_white9]
      [0.20 bright_white10]
      [0.20 bright_white8]
      [0.25 bright_white9]
      [0.25 bright_white7]
      [0.30 bright_white8]
      [0.30 bright_white6]
      [0.35 bright_white7]
      [0.35 bright_white5]
      [0.40 bright_white6]
      [0.40 bright_white4]
      [0.45 bright_white5]
      [0.45 bright_white3]
      [0.50 bright_white4]
      [0.50 bright_white2]
      [0.55 bright_white3]
      [0.55 bright_white1]
      [0.60 bright_white2]
      [0.60 bright_white]
      [0.65 bright_white1]
      [0.65 bright_white]
      [1    bright_white0]
      scale 600 translate path1_spline(clock1+path1_offset)+85*y
    }
  }
}


Post a reply to this message

From: Christopher James Huff
Subject: Re: Need help with object pattern syntax...
Date: 4 Mar 2004 14:41:10
Message: <cjameshuff-391A20.14421204032004@news.povray.org>
In article <4046c611@news.povray.org>, "Carl Hoff" <hof### [at] wtnet> wrote:

> I've got this coded so I can animate the trail and I need to add the fixed
> lines of white that will be added as the bike moves along its path at
> regular intervals.  I thought something like this would work and cause
> where ever the trail passed through one of the fixes cylinders to be
> assigned the texture "bright_white" and use the complicated moving
> spherical texture map to be used outside the cylinders.  The example I
> was copying was a pigment object pattern.  Can the same effect be used
> on textures?  If so do I just have a syntax problem below.  The variable
> clock1 below will be replaced with clock in the final animation.  I've just
> renamed it so I could manually assign it for making quick test renders.

Please make some attempt to reduce your code to the part that shows the 
actual problem. In doing so, you will often find the problem yourself, 
and even if you don't, it makes things easier for the people reading 
your message.

For example, your code could have been reduced to this:

object {plane {y, 0}
    texture {
        object {
            sphere {< 0, 0, 0>, 1}
            texture {pigment {rgb 1}}
        }
        spherical
        texture_map {
            [0 pigment {rgb 0}]
            [1 pigment {rgb 1}]
        }
    }
}

Which requires no other code to parse, is far shorter, and makes the 
main problem quite obvious.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Carl Hoff
Subject: Re: Need help with object pattern syntax...
Date: 4 Mar 2004 15:07:34
Message: <40478c86@news.povray.org>
> Please make some attempt to reduce your code to the part that
> shows the actual problem. In doing so, you will often find the
> problem yourself,

Sorry... I'm still learning the ropes.

> and even if you don't, it makes things easier for the people
> reading your message.

I see your point and I agree 100%.

> For example, your code could have been reduced to this:
>
> object {plane {y, 0}
>     texture {
>         object {
>             sphere {< 0, 0, 0>, 1}
>             texture {pigment {rgb 1}}
>         }
>         spherical
>         texture_map {
>             [0 pigment {rgb 0}]
>             [1 pigment {rgb 1}]
>         }
>     }
> }
>
> Which requires no other code to parse, is far shorter, and
> makes the main problem quite obvious.

I see this certainly has the same problem as my pieces of
code.  What I was trying to copy was this piece of code:

object{object_a}
   pigment
      {object {object_b}
            pigment {rgb 0.5}
            pigment {rgb <1,0,0>}
      }
   }
}

Except I want to use a texture object pattern and not a
pigment one.  Is it even doable?  I'm thinking its just
a syntax problem but I can't find an example of a texture
object patern to copy.  I want something that assigns
one texture inside the object and a spherical texture map
outside the object.  I was also wanting to scale the
second texture and not the first.  I'm still new enough the
problem isn't obvious to me.

Can you give me another push in the right direction?
Carl


Post a reply to this message

From: Christopher James Huff
Subject: Re: Need help with object pattern syntax...
Date: 4 Mar 2004 21:42:41
Message: <cjameshuff-B9EB92.21434404032004@news.povray.org>
In article <40478c86@news.povray.org>, "Carl Hoff" <hof### [at] wtnet> wrote:

> I see this certainly has the same problem as my pieces of
> code.  What I was trying to copy was this piece of code:
> 
> object{object_a}
>    pigment
>       {object {object_b}
>             pigment {rgb 0.5}
>             pigment {rgb <1,0,0>}
>       }
>    }
> }

Okay, here you have an object pattern with two pigments. To make a 
version using textures, just replace each pigment with a texture. Now 
see where you went wrong with the first one? You specify one texture 
inside the object pattern block, and give a complete separate texture 
after it.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Carl Hoff
Subject: Re: Need help with object pattern syntax...
Date: 5 Mar 2004 09:14:31
Message: <40488b47@news.povray.org>
> Okay, here you have an object pattern with two pigments. To make a
> version using textures, just replace each pigment with a texture. Now
> see where you went wrong with the first one? You specify one texture
> inside the object pattern block, and give a complete separate texture
> after it.

Ok... it took me nearly an hour to get it working last night as I thought
I was still missing something.  I was stuck trying to put both textures
after the object block. It wasn't till I went one { at a time till I saw
both
needed to be inside it.  And even then I found I had to add the word
texture again ahead of spherical for it to work.  I also quickly learned
I had the two textures listed in the wrong order for it to do what I
wanted it to do.  I guess I shouldn't be staying up so late working on
this stuff.  Yes... the solution now jumps out at me now that I've
solved the problem.  Till I had the fix it sure didn't seem obvious.

Thanks for the help and I hope I didn't sound too dense,
Carl


Post a reply to this message

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