POV-Ray : Newsgroups : povray.general : mesh2 syntax query : Re: mesh2 syntax query Server Time
29 Jul 2024 00:32:16 EDT (-0400)
  Re: mesh2 syntax query  
From: David Given
Date: 7 Dec 2013 14:45:56
Message: <52a37af4$1@news.povray.org>
On 07/12/13 18:24, David Given wrote:
[...]
> 	face_indices {
> 		12,
> 		<0, 1, 2>, 1, 0, 1,

Arrgh --- I hadn't twigged that the texture values here are *integers*
--- indices into the texture list. Interpolation isn't done if you
supply a fractional value.

So instead I've wedged my texture values into the u channel of the uv
mapping, and am then doing this:

	object
	{
		mesh2
		{
			#include "/tmp/mesh.inc"
		}
		scale km

		uv_mapping texture
		{
			gradient x

			texture_map
			{
				[0.0 pigment { rgb <1, 0, 0> }]
				[1.0 pigment { rgb <0, 1, 0> }]
			}
		}
	}

Simple, easy, effective, and doesn't need face_indices at all.

In fact this has shown up a fundamental flaw in my logic, which is that
by using a simple linear range of textures like this I can't interpolate
from texture #0 to texture #10 without going through all the textures in
between, which would look a bit odd. So I'm going to have to rethink my
reasoning from the ground up.

-- 
┌─── dg@cowlark.com ─────
http://www.cowlark.com ─────
│ "There does not now, nor will there ever, exist a programming
│ language in which it is the least bit hard to write bad programs." ---
│ Flon's Axiom


Post a reply to this message

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