POV-Ray : Newsgroups : povray.programming : #Bitwise operations Server Time
25 Dec 2024 22:12:17 EST (-0500)
  #Bitwise operations (Message 1 to 10 of 10)  
From: Ken
Subject: #Bitwise operations
Date: 3 Sep 1999 15:34:06
Message: <37D02258.CCBCEFD7@pacbell.net>
What are bitwise operations and why would someone use them in povray ?

-- 
Ken Tyler

See my 850+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html


Post a reply to this message

From: Ron Parker
Subject: Re: #Bitwise operations
Date: 3 Sep 1999 15:44:47
Message: <37d0252f@news.povray.org>
On Fri, 03 Sep 1999 12:32:40 -0700, Ken wrote:

>What are bitwise operations and why would someone use them in povray ?

They're operations that perform logical manipulations (and/or/not) on
the individual bits of a number.  I saw one person on cgrr who was using 
them to generate patterns that appeared random but were actually not.
In general they're far more useful for programming tasks than for general
mathematical stuff.


Post a reply to this message

From: Margus Ramst
Subject: Re: #Bitwise operations
Date: 3 Sep 1999 17:08:17
Message: <37D038B4.68E7F661@peak.edu.ee>
Ron said what they are. I can only say this: I just recently wished I had
bitwise operators. This would have enabled me to create a random number
generator in POV, which (I think) would have facilitated creating a Perlin noise
macro.
As things stand, I have a working 1D Perlin noise macro, but for the life of me
I can't figure out how to extend it into multiple dimensions. OTOH, I basically
re-invented the wheel here; I haven't looked at how it's done in POV etc. And
since I figured out a bypass, the project is dormant.

Margus

Ken wrote:
> 
> What are bitwise operations and why would someone use them in povray ?
> 
> --
> Ken Tyler
> 
> See my 850+ Povray and 3D Rendering and Raytracing Links at:
> http://home.pacbell.net/tylereng/index.html


Post a reply to this message

From: Ken
Subject: Re: #Bitwise operations
Date: 3 Sep 1999 17:18:16
Message: <37D03AC1.99B0652D@pacbell.net>
Margus Ramst wrote:
> 
> Ron said what they are. I can only say this: I just recently wished I had
> bitwise operators. This would have enabled me to create a random number
> generator in POV, which (I think) would have facilitated creating a Perlin noise
> macro.
> As things stand, I have a working 1D Perlin noise macro, but for the life of me
> I can't figure out how to extend it into multiple dimensions. OTOH, I basically
> re-invented the wheel here; I haven't looked at how it's done in POV etc. And
> since I figured out a bypass, the project is dormant.
> 
> Margus

I have a link to an include file that adds bitwise operaters to Pov. Thus
the reason for the question in the first place.

See: http://www.enter.net/~cfusner/tutorial/tutorial.html#Samples

-- 
Ken Tyler

See my 850+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html


Post a reply to this message

From: Jerry Stratton
Subject: Re: #Bitwise operations
Date: 4 Sep 1999 14:10:02
Message: <newsw-0409991110030001@cx38767-a.dt1.sdca.home.com>
In article <37D02258.CCBCEFD7@pacbell.net>, Ken <tyl### [at] pacbellnet> wrote:

>What are bitwise operations and why would someone use them in povray ?

One of the (many) useful things to do with bitwise operations is parameter
passing.

#declare Frogs=1;
#declare Possum=2;
#declare Herps=4;
#declare Elves=8;

#macro trueSwamp(animals)

   #if (animals bitand Frogs)
      #add frogs
   #end
   #if (animals bitand Possum)
      #add possum
   #end
   #if (animals bitand Herps)
      #add herps
   #end
   #if (animals bitand Elves)
      #add elves
   #end

#end


//make a swamp with frogs and Elves
trueSwamp(Frogs + Elves)

Jerry
http://www.hoboes.com/jerry/


Post a reply to this message

From: gimi
Subject: Re: #Bitwise operations
Date: 7 Oct 1999 22:28:47
Message: <37FD567E.C637E9EB@psico.ch>
hi all,

Ken wrote:
> What are bitwise operations and why would someone use them in povray ?

i have been working on bitops for povray
because i thought i would need it for a
project - then i did that in perl.. ;)

(i am currently producing loads of pov
include files with some perl scripts -
nice physical modelling stuff. mail me
personally if this is of any interest)

anyway, heres what ive got so far; without
any guarantee that it does what it claims.

its an .inc file with some macros, all
comments are in german; but youll get it.


gimi

master of (all || nothing) :)
-- 
home:  http://www.psico.ch/
mail:  mailto:*@psico.ch      mailnot:gimi@:).ch


Post a reply to this message


Attachments:
Download 'logic.inc.txt' (4 KB)

From: S  Parker
Subject: Re: #Bitwise operations
Date: 20 Nov 1999 01:54:24
Message: <38364773.CDFEB12@sprynet.com>
Good grief!  I brought this subject up in September of *last* year and no
one responded so I dropped it.  Anyway, here is the original message.

Subject:  bit-wise operators and base-n numbers
Date: Sun, 06 Sep 1998 13:17:37 -0500
From: "S. Parker" <sbp### [at] sprynetcom>
Newsgroups: povray.programming

    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 switches or "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

From: gimi
Subject: Re: #Bitwise operations
Date: 1 Dec 1999 16:22:19
Message: <3845915E.1C30C50D@psico.ch>
me again;

"S. Parker" wrote:
> Good grief!  I brought this subject up in September of *last* year and no
> one responded so I dropped it.  Anyway, here is the original message.

whoo-ee what a shame. - i didnt read the date
then, i guess. never mind, i think ken has
#included it in one of thousands of lists
of lists of lists of include files written
solely for the purpose of being included
somewhere.

i dont care - i switched - again - from
perl to g++ and beos. time to get pov
running there :)


ciao

gimi

mestre confus
-- 
home:  http://www.psico.ch/
mail:  mailto:*@psico.ch      mailnot:gimi@:).ch


Post a reply to this message

From: mr art
Subject: Re: #Bitwise operations
Date: 1 Dec 1999 23:12:20
Message: <3845F18D.60745373@gci.net>
Hi. I haven't run into anyone yet (except you)
that is running beos. Could you tell me what it
is like, how things are going, and stuff like that?
I like to investigate new/different os's.
Mr. Art

gimi wrote:
> 
> me again;
> 
> "S. Parker" wrote:
> > Good grief!  I brought this subject up in September of *last* year and no
> > one responded so I dropped it.  Anyway, here is the original message.
> 
> whoo-ee what a shame. - i didnt read the date
> then, i guess. never mind, i think ken has
> #included it in one of thousands of lists
> of lists of lists of include files written
> solely for the purpose of being included
> somewhere.
> 
> i dont care - i switched - again - from
> perl to g++ and beos. time to get pov
> running there :)
> 
> ciao
> 
> gimi
> 
> mestre confus
> --
> home:  http://www.psico.ch/
> mail:  mailto:*@psico.ch      mailnot:gimi@:).ch


Post a reply to this message

From: gimi
Subject: Re: #Bitwise operations
Date: 20 Jan 2000 14:48:30
Message: <38811686.8428EAC6@psico.be.ch>
hi

"mr.art" wrote:
> 
> Hi. I haven't run into anyone yet (except you)
> that is running beos. Could you tell me what it
> is like, how things are going, and stuff like that?
> I like to investigate new/different os's.
> Mr. Art
> 
> gimi wrote:

first, you should reply to people
personally (by email) if you have
personal (and off-topic) questions.

your problem just reached me and
completely by accident - i do not
even regularly browse these groups.

now for your question. i cant go
into details of course, but heres
what i think.

it looks like other os' do, but
has funny window titles that only
are as wide as they need to be. :)

things are going extremely well,
it has never crashed; i only had
to shoot some apps, but this was
no problem for the system.

the only prob is that there is
absolutely no commercial support
for this wonderful thing. pity.

some cool demos, several beta-
versions and thats it.

i guess the point is that this
os was released way to late. had
they made some more noise about
it before the linux rush began,
they would have had a good
position.

so, whats my opinion? i love it.
but then.. no games (well, there
is quake ;) , no drivers (aargh,
i crave for directB :B ) and not
a single software title availabe
in stores (at least not around
here. :(

youll have to decide for yourself,
whether this is worth 100 bucks.

if you dont absolutely need it
you should imho go for linux, its
cheaper and does the same.

btw, installation is simple, but
any win9x installation after this
will overwrite beos' boot manager
	:O~* [puke]

all right, thats all i can say;
you can go to be.com and related
sites to learn more. they also
have other sites showing links
to downloadable software.


gimi

master of no want write long mail :D
-- 
home:  http://www.psico.ch/
mail:  mailto:*@psico.ch      mailnot:gimi@:).ch


Post a reply to this message

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