POV-Ray : Newsgroups : povray.binaries.images : Scatter (103k) Server Time
19 Aug 2024 12:15:15 EDT (-0400)
  Scatter (103k) (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: David Fontaine
Subject: Re: Scatter (103k)
Date: 18 Dec 2000 00:43:15
Message: <3A3DA319.E01AC0ED@faricy.net>
This would be cool with slope/pattern-dependent
placement/coloration/etc.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: ian mcdonald
Subject: Re: Scatter (103k)
Date: 18 Dec 2000 08:48:45
Message: <3a3e15bd$1@news.povray.org>
Very nice. :)
I love the random nature of this.
I still haven't figured out trace(), nor has any attempt been made to do so.

ian

Andy Cocker <big### [at] mariner9fsnetcouk> wrote in message
news:3a3d2785@news.povray.org...


Post a reply to this message

From: Andy Cocker
Subject: Re: Scatter (103k)
Date: 18 Dec 2000 14:53:33
Message: <3a3e6b3d@news.povray.org>
"ian mcdonald" <ian### [at] hotmailcom> wrote in message
news:3a3e15bd$1@news.povray.org...
> Very nice. :)
> I love the random nature of this.
> I still haven't figured out trace(), nor has any attempt been made to do
so.

Well, I should own up and say that I haven't figured it out either. This
image was made by adapting one of the demo files that come with megaPOV. :-)

I've just tried to change the scene so that the HF was replaced by some text
on a plane, but I couldn't get it to work. I don't quite understand what #if
(Norm.x != 0 | Norm.y != 0 | Norm.z != 0) means, but I've yet to really look
into it.

Andy


Post a reply to this message

From: Chris Huff
Subject: Re: Scatter (103k)
Date: 18 Dec 2000 15:06:29
Message: <chrishuff-B4EB2C.15073418122000@news.povray.org>
In article <3a3e6b3d@news.povray.org>, "Andy Cocker" 
<big### [at] mariner9fsnetcouk> wrote:

> I don't quite understand what #if (Norm.x != 0 | Norm.y != 0 | Norm.z 
> != 0) means, but I've yet to really look into it.

If the trace() function doesn't find an intersection, it will return < 
0, 0, 0> as the normal. This allows you to find out if it actually hit 
something.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Andy Cocker
Subject: Re: Scatter (103k)
Date: 18 Dec 2000 21:37:58
Message: <3a3eca06@news.povray.org>
"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-B4EB2C.15073418122000@news.povray.org...
> In article <3a3e6b3d@news.povray.org>, "Andy Cocker"
> <big### [at] mariner9fsnetcouk> wrote:
>
> > I don't quite understand what #if (Norm.x != 0 | Norm.y != 0 | Norm.z
> > != 0) means, but I've yet to really look into it.
>
> If the trace() function doesn't find an intersection, it will return <
> 0, 0, 0> as the normal. This allows you to find out if it actually hit
> something.

Thanks Chris. It was the ! and the | predominantly that I didn't understand,
but I think I've got it figured out... my new scene is behaving as I want it
to anyway.
Would I be correct in thinking that the ! stands for 'does not', and the |
signifies 'and', thus the code reads "unless the trace function returns
<0,0,0>, then parse the following.. otherwise goto #else"?
Forgive me, this is probably really elementary programming syntax, but I'm
no programmer. According to the docs then I think I'm right.

All the best,

Andy Cocker


Post a reply to this message

From: Chris Huff
Subject: Re: Scatter (103k)
Date: 18 Dec 2000 21:59:13
Message: <chrishuff-CA4F95.22001918122000@news.povray.org>
In article <3a3eca06@news.povray.org>, "Andy Cocker" 
<big### [at] mariner9fsnetcouk> wrote:

> Would I be correct in thinking that the ! stands for 'does not', and 
> the | signifies 'and', thus the code reads "unless the trace function 
> returns <0,0,0>, then parse the following.. otherwise goto #else"?

Close, very close:
"!" means "not", like you said, so "!=" means "is not equal to". "|" 
means "or", not "and", so this statement:

#if(Norm.x != 0 | Norm.y != 0 | Norm.z != 0)
A
#else
B
#end

Means:
"If Norm.x is not 0, or if Norm.y is not 0, or if Norm.z is not 0, do A, 
otherwise do B."
In other words:
"If any component of Norm is not 0, do A, otherwise do B."


The "&" symbol means "and", so it could also be written as:
#if(!(Norm.x = 0 & Norm.y = 0 & Norm.z = 0))
Which translates nicely into English as:
"If not all the components of Norm are equal to 0..."

And the reason for all this is that you can't compare normals...I 
usually use a vEq(V1, V2) macro:
#if(!vEq(Norm, < 0, 0, 0>))
or a vNull(V) macro:
#if(!VNull(Norm))

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Andy Cocker
Subject: Re: Scatter (103k)
Date: 18 Dec 2000 22:14:55
Message: <3a3ed2af@news.povray.org>
Hey, thanks, that helped a lot. You certainly know your stuff...

So, I've figured out how to use trace () to 'drop' my objects onto my hf
etc... but at present they are all vertical. I'd really like to get them to
be perpendicular to the object they've landed on.. I take it I need to use
the data that  trace () returned to give me the surface normal, and then
rotate each object to match... at present I am very unclear how to do this,
but I realise it's bad practise to ask here before I've really tried to
achieve this myself , so I'll go away now and try to fathom it out.

Of course, there's no sense me trying to re-invent the wheel, so any
suggestions would be gratefully received.

All the best,

Andy Cocker


Post a reply to this message

From: Chris Huff
Subject: Re: Scatter (103k)
Date: 18 Dec 2000 22:34:21
Message: <chrishuff-BF9B97.22352618122000@news.povray.org>
In article <3a3ed2af@news.povray.org>, "Andy Cocker" 
<big### [at] mariner9fsnetcouk> wrote:

> I take it I need to use the data that  trace () returned to give me 
> the surface normal, and then rotate each object to match... at 
> present I am very unclear how to do this,
...

Try the Reorient macro, it is on the Thoroughly Useful Macros page:
http://users4.50megs.com/enphilistor/macs.htm

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Mark Wagner
Subject: Re: Scatter (103k)
Date: 19 Dec 2000 03:13:30
Message: <3a3f18aa$1@news.povray.org>
Chris Huff wrote in message ...
>In article <3a3ed2af@news.povray.org>, "Andy Cocker"
><big### [at] mariner9fsnetcouk> wrote:
>
>> I take it I need to use the data that  trace () returned to give me
>> the surface normal, and then rotate each object to match... at
>> present I am very unclear how to do this,
>...
>
>Try the Reorient macro, it is on the Thoroughly Useful Macros page:
>http://users4.50megs.com/enphilistor/macs.htm


Or get an include file that can do all that here:
http://www.geocities.com/Rengaw03/povray.html

It's the "vegetate.zip" file.

--
Mark


Post a reply to this message

From: Andy Cocker
Subject: Re: Scatter (103k)
Date: 19 Dec 2000 13:09:46
Message: <3a3fa46a@news.povray.org>
"Mark Wagner" <mar### [at] gtenet> wrote in message
news:3a3f18aa$1@news.povray.org...
> Or get an include file that can do all that here:
> http://www.geocities.com/Rengaw03/povray.html
>
> It's the "vegetate.zip" file.

Great, thanks.

Andy Cocker


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

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