POV-Ray : Newsgroups : povray.beta-test : Array of 4D vectors Server Time
2 Nov 2024 01:19:16 EDT (-0400)
  Array of 4D vectors (Message 1 to 1 of 1)  
From: mm
Subject: Array of 4D vectors
Date: 22 Jan 2002 03:54:18
Message: <3c4d28ba@news.povray.org>
POV 3.5 b 10, win

I am trying to do some math with 4D vectors, and it leads to a variety of
problems, including abnormal termination of PovRay. I have not yet pinned
down most of the problems, here is a simple one:

When I run :

  #macro test()
    <1, 1, 1, 1>
  #end

  #declare aa = array[2] {<1, 1, 1, 1>, <1, 0, 1, 1>}
  #declare bb = array[2] {test(), <1, 0, 1, 1>}

there is a parsing error on 'bb', 'insufficient number of initialisers'.
More generally, I never managed to initialise an array with a macro
returning a 4D vector.

If the order is changed :

#declare bb = array[2] {<1, 0, 1, 1>, test()}

the parsing error is then 'Attempted to redefine 4d-vector identifier as
object identifier'.

On the other hand

#declare vv = test();
#declare bb = array[2] {vv, <1, 0, 1, 1>}

is OK.

Michel Mouly


Post a reply to this message

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