POV-Ray : Newsgroups : povray.newusers : Something strange is happening to me (again) : Re: Something strange is happening to me (again) Server Time
20 Oct 2025 16:50:27 EDT (-0400)
  Re: Something strange is happening to me (again)  
From: William F Pokorny
Date: 20 Oct 2025 06:49:53
Message: <68f613d1$1@news.povray.org>
On 10/20/25 03:53, kurtz le pirate wrote:
> Let an array of "4D" vectors.
> This code works well :
> 
> #write ( FH, Array[i].x,",",Array[i].y,",",Array[i].z,",",Array[i].filter )

Below the contents of a documentation scene I'm adding to the next yuqk 
release (R20). What's going on is part of a larger tangle due when and 
how the features involved were implemented over time.

Bill P.

//---
// Odd behavior with 'write' and 5D color vectors...

#declare V2 = <1,2>;
#declare V3 = <1,2,3>;
#declare V4 = <1,2,3,4>;
#declare V5 = <1,2,3,4,5>; // Internally this a 'color vector'

#fopen FH "zzz" write

// These are OK in yuqk or in v3.8 beta 2
#write (FH,V3.x,",",V3.y,",",V3.z)
#write (FH,V4.x,",",V4.y,",",V4.z,",",V4.t)
#write (FH,(V5.x),",",(V5.y),",",(V5.z))
#write (FH,(V5.x),",",(V5.y),",",(V5.z)",",(V5.t))
#write (FH,(V5.x),",",(V5.y),",",(V5.z)",",(V5.t)",",(V5.transmit))
#write (FH,V2)
#write (FH,V3)
#write (FH,V4)

// This fails in yuqk and in v3.8 beta 2 because 'write' only
// supports 2D, 3D and 4D vectors.
#if (0)
#write (FH,V5)
#end

// This fails in v3.8 beta 2 because 'write' only supports 2D, 3D
// and 4D vectors. Due how the dot operator works, incorrectly,
// for the v3.8 tuple feature the V5.transmit is first seen as a 5D
// color vector - before it is seen as a float due the dot operator.
#if (0)
#write (FH,V5.transmit)
#end

// These fail in yuqk due fixes with the tuple assignment feature of
// v3.8 which changes how the dot operators are evaluated. The yuqk
// fork always sees 'V5' before it thinks about the dot operator. In
// other words, with yuqk you must wrap all, 5D color vector, element
// to float conversions in ()s with write!
#if (0)
#write (FH,V5.x,",",V5.y,",",V5.z)
// #write (FH,V5.x,",",V5.y,",",V5.z,",",V5.t)
// #write (FH,V5.x,",",V5.y,",",V5.z,",",V5.transmit)
#end

#fclose FH

#error "Stop early"
//---

Bill P.


Post a reply to this message

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