POV-Ray : Newsgroups : povray.programming : bit-wise operators and base-n numbers Server Time
29 Jul 2024 06:24:42 EDT (-0400)
  bit-wise operators and base-n numbers (Message 1 to 1 of 1)  
From: S  Parker
Subject: bit-wise operators and base-n numbers
Date: 6 Sep 1998 15:17:41
Message: <35F2D1C1.3B7928A7@sprynet.com>
POV Ray is becoming more and more of a full-blown programming
language.  I recently undertook a POV project that created a maze.
In the maze there were doors and switches and lights that could be
turned on and off, items that could be moved or picked up, elevators
that
could go up or down, etc...depending upon how certain "flags" were set.

The only problem was that I had to write include files that would
extract "bit" settings from "hex" numbers.  Well POV doesn't support hex
or
bit-wise operators so...
I had to use strings to represent the hex fields, convert them to
decimal, perform all sorts arithmetic operations to simulate AND, OR,
XOR,
shift and rotate operations, then re-embed the modified bit fields back
into the decimal numbers and convert them back into hex (whew!)
all so my original hex string would reflect the operation that was
performed on it.

Which brings me back to my first sentence...since POV Ray is becoming a
programming language unto itself....would the POV Ray design
team please, Please, PLEASE, consider adding these capabilities into the
next release.  They would be extremely useful in event driven
animations and I (and hopefully a few others) would be forever in your
debt.

Stevie B


Post a reply to this message

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