POV-Ray : Newsgroups : povray.beta-test : Texture translation bug with Center_Trans() : Texture translation bug with Center_Trans() Server Time
28 Jul 2024 18:12:16 EDT (-0400)
  Texture translation bug with Center_Trans()  
From: Chambers
Date: 31 Jan 2008 01:57:14
Message: <47a1714a@news.povray.org>
I'm not sure how to describe what is happening, other than that objects 
inside unions have their textures translated in odd ways by the 
Center_Trans macro.

Consider this scene:
--------------------
#include "transforms.inc"

camera {
	location -z*2
	look_at 0
}

#declare tube = union {
	cylinder {
		0, y, 1/10
		pigment {
			gradient y
			color_map {
				[0 color rgb x]
				[1 color rgb z]
			}
		}
	}
}

object {tube Center_Trans(tube, x+y+z) rotate z*90 translate y/4}
object {tube rotate z*90 translate y*0.5+x*0.5}

#declare tube2 = cylinder {
	0, y, 1/10
	pigment {
		gradient y
		color_map {
			[0 color rgb y]
			[1 color rgb 1]
		}
	}
}

object {tube2 Center_Trans(tube2, x+y+z) rotate z*90 translate -y/4}
object {tube2 rotate z*90 translate -y*0.5+x*0.5}

light_source {
	<1,1,-1>*10 color rgb 1
}
--------------------

Rendered in 3.6, both pairs of tubes are identical.

Rendered in 3.7, we can see that the upper tube's texture is translate 
wrt it's pair's texture, despite them being identical objects.  The only 
difference is that the one object is translated via Center_Trans(), 
while the other is not.

The second pair of tubes, in which the cylinder itself is the object 
(rather than being contained inside a union), does not exhibit this bug.

This leads me to believe that the problem is the combination of 
Center_Trans(), unions, and textures.  But I'm not sure why, or exactly how.

Sorry I couldn't give more detailed info, but this one was quite tricky 
for me to track down.

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

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