POV-Ray : Newsgroups : povray.binaries.images : Bezier Lathe UV Mapping bug Server Time
15 Nov 2024 02:27:24 EST (-0500)
  Bezier Lathe UV Mapping bug (Message 1 to 2 of 2)  
From: Edouard Poor
Subject: Bezier Lathe UV Mapping bug
Date: 21 Sep 2008 17:25:31
Message: <48d6bbcb@news.povray.org>
I'm finding that my bezier_spline lathes get uv_mapped pigments wrong - 
the y component is inverted inside each spline segment.

Attached is a picture, and the source, showing the problem (and that the 
other spline types, and sors, are unaffected).

Is this a known bug? I couldn't find any other references to it, but 
maybe my google-foo failed...

Cheers,
Edouard.



camera {
	perspective
	location < 0.0, 3, -6>
	right x * 1
	up y * image_height / image_width
	angle 45
	look_at < 0, 0.5, 0>
}

light_source {
	< -20, 15, -15>
	rgb 1
}

plane {
	<0.0, 1.0, 0.0>, 0.0
	pigment { checker rgb 1, rgb 0.8 }
}

#declare linear_lathe =
lathe {
	linear_spline
	7,
	<0.00000, 0.00000>,	<0.25000, 0.06699>,
	<0.43301, 0.25000>,	<0.50000, 0.50000>,
	<0.43301, 0.75000>,	<0.25000, 0.93301>,
	<0.00000, 1.00000>
}


#declare quadratic_lathe =
lathe {
	quadratic_spline
	8,
	<0.00000, 0.00000>,	<0.00000, 0.00000>,
	<0.25000, 0.06699>,	<0.43301, 0.25000>,
	<0.50000, 0.50000>,	<0.43301, 0.75000>,
	<0.25000, 0.93301>,	<0.00000, 1.00000>
}


#declare cubic_lathe =
lathe {
	cubic_spline
	9,
	<0.00000, 0.00000>,	<0.00000, 0.00000>,
	<0.25000, 0.06699>,	<0.43301, 0.25000>,
	<0.50000, 0.50000>,	<0.43301, 0.75000>,
	<0.25000, 0.93301>,	<0.00000, 1.00000>,
	<0.00000, 1.00000>
}


#declare bezier_lathe =
lathe {
	bezier_spline
	24,
	<0.00000, 0.00000>,	<0.08682, 0.00760>,
	<0.17101, 0.03015>,	<0.25000, 0.06699>,
	<0.25000, 0.06699>,	<0.32139, 0.11698>,
	<0.38302, 0.17861>,	<0.43301, 0.25000>,
	<0.43301, 0.25000>, 	<0.46985, 0.32899>,
	<0.49240, 0.41318>,	<0.50000, 0.50000>,
	<0.50000, 0.50000>,	<0.49240, 0.58682>,
	<0.46985, 0.67101>,	<0.43301, 0.75000>,
	<0.43301, 0.75000>,	<0.38302, 0.82139>,
	<0.32139, 0.88302>,	<0.25000, 0.93301>,
	<0.25000, 0.93301>,	<0.17101, 0.96985>,
	<0.08682, 0.99240>,	<0.00000, 1.00000>
}


#declare uv_pigment =
pigment {
	uv_mapping
	gradient y
	color_map {
		[ 0.0	rgb <1,0,0> ]
		[ 0.333	rgb <0,0,1> ]
		[ 0.666	rgb <0,1,0> ]
		[ 1.0	rgb <1,0,0> ]
	}
}

lathe {
	linear_lathe
	pigment { uv_pigment }
	translate x*-1.8
}

lathe {
	quadratic_lathe
	pigment { uv_pigment }
	translate x*-0.6
}

lathe {
	cubic_lathe
	pigment { uv_pigment }
	translate x*0.6
}

lathe {
	bezier_lathe
	pigment { uv_pigment }
	translate x*1.8
}

sor {
	9
	<0.00000, 0.00000>,	<0.00000, 0.00000>,
	<0.25000, 0.06699>,	<0.43301, 0.25000>,
	<0.50000, 0.50000>,	<0.43301, 0.75000>,
	<0.25000, 0.93301>,	<0.00000, 1.00000>,
	<0.00000, 1.00000>
	pigment { uv_pigment }
	translate z*1.8
}


Post a reply to this message


Attachments:
Download 'uv_lathe_bug.jpg' (39 KB)

Preview of image 'uv_lathe_bug.jpg'
uv_lathe_bug.jpg


 

From: Edouard Poor
Subject: Re: Bezier Lathe UV Mapping bug
Date: 22 Sep 2008 06:17:29
Message: <48d770b9@news.povray.org>
I wrote:

> I'm finding that my bezier_spline lathes get uv_mapped pigments wrong - 
> the y component is inverted inside each spline segment.

For my purposes I can (did) change my SVG to lathe code to output the 
lathe segments reversed, which makes the uv mapped pigments (or 
textures, etc) all work fine.

So where I was outputting segments A->B, B->C, C->D, etc, now I'm 
outputting B->A, C->B, D->C etc.

Seems like bit of a dirty work-around, but at least it works for now.

Cheers,
Edouard.


Post a reply to this message


Attachments:
Download 'reversed-lathe-cup.jpg' (46 KB)

Preview of image 'reversed-lathe-cup.jpg'
reversed-lathe-cup.jpg


 

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