POV-Ray : Newsgroups : povray.binaries.images : Chromadepth scaling to model : Chromadepth scaling to model Server Time
27 Apr 2024 13:13:25 EDT (-0400)
  Chromadepth scaling to model  
From: Mike Horvath
Date: 17 Feb 2018 07:29:13
Message: <5a882019@news.povray.org>
So, I am using this macro to generate chromadepth textures:


// this script assumes the depth effect is *linear* from near to far,
// which may not be the case
// red, white, blue
#macro MakeChromadepthTextureCameraRWB(CameraLocation, CameraLookAt)
	#local iMax = 240;
	pigment
	{
		spherical
		color_map
		{
			[0.0 color srgb <0,0,1>]
			[0.5 color srgb <1,1,1>]
			[1.0 color srgb <1,0,0>]
		}
	}
//	finish
//	{
//		ambient 1
//		diffuse 0
//	}
	scale vlength(CameraLocation - CameraLookAt) * 2
	translate CameraLocation
#end

The texture is centered on the camera location, and stretches to a point 
opposite the model. The problem is that the model ends up mostly white, 
with only touches of blue and red, as you can see in the attached image.

I think the texture should hug the model a bit closer, so that more red 
and blue are visible. The problem is that the texture is centered on the 
camera instead of the model, or I could just scale the texture a bit 
smaller.

What method can I use to fix the texture? I know what the model's center 
point and bounding box are.

Thanks.


Mike


Post a reply to this message


Attachments:
Download 'wrapper_showcase.jpg' (225 KB)

Preview of image 'wrapper_showcase.jpg'
wrapper_showcase.jpg


 

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