POV-Ray : Newsgroups : povray.general : material coordinate systems : material coordinate systems Server Time
31 Jul 2024 14:29:56 EDT (-0400)
  material coordinate systems  
From: Calvin
Date: 27 Dec 2006 23:45:01
Message: <web.45934bc8dd4d8e8ce637b1f80@news.povray.org>
I've hunted a bit in the docs and the newsgroups, but was rather surprised
to not be able to find a simple solution for this problem. I figured that
someone might know a workaround, so I thought I would ask.

What I want to do is to use world coordinates in a material, without needing
to set the material at a root level. Normally this wouldn't be a problem,
but I have a lot of objects with different materials inside a union, of
which there are many instances. I want the material for each instance to
use the world coordinate system, but there does not appear to be a way to
do that.

As an example:

#declare myComposite = union {
    object {
        complicatedObject1
        material{material1}
    }

    object {
        complicatedObject2
        material{material2}
    }
}

object { // instance 1
    myComposite
    translate <...>
    rotate <...>
}

object { // instance 2
    myComposite
    translate <...>
    rotate <...>
}

I want both instances to use the same coordinate system in their materials,
but that doesn't work with the current code.

The only way I know how to do this is to reorganize the groups so that I am
creating unions based on materials, and then to assign the material at the
top level, but for repeated objects with complicated materials, this gets
really tedious.

Does anyone know any good workarounds for this?
Thank you!


Post a reply to this message

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