 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I followed Norbert's suggestion and added the possibility to place the
objects on a landscape (just one line of code).
My next effort is something concerning the textures of the placed objects
(i.e. they could be influenced by another map, or by their position, or by
the relative position of the objects around...) but I haven't got any good
and clear idea yet.
In this example 500 spheres and 500 boxes are placed on a landscape
following a simple checker pattern.
Feedback is appreciated.
Jonathan.
Post a reply to this message
Attachments:
Download 'clutter4.jpg' (110 KB)
Preview of image 'clutter4.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"JRG" <jrg### [at] hotmail com> wrote in message
news:3b460665@news.povray.org...
> I followed Norbert's suggestion and added the possibility to place the
> objects on a landscape (just one line of code).
> My next effort is something concerning the textures of the placed objects
> (i.e. they could be influenced by another map, or by their position, or by
> the relative position of the objects around...) but I haven't got any good
> and clear idea yet.
> In this example 500 spheres and 500 boxes are placed on a landscape
> following a simple checker pattern.
>
> Feedback is appreciated.
Could you include re-orientation of the objects to the normal of the
landscape as an option?
Looks great!
All the best,
Andy
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> I followed Norbert's suggestion and added the possibility to place the
> objects on a landscape (just one line of code).
<snip>
That's coming along nicely! In fact this does exactly what I was trying to
do with a grass macro that never went anywhere. Could you post the one line
of code? I never got the hang of the trace function.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
If you want to know the y coordinate of a point (i.e. its height):
#local _alt=vdot(y,trace( land, temp_pos+10000*y,-y)); // check the
altitude
or, even easier:
#local _alt=(trace( land, temp_pos+10000*y,-y)).y; // check the altitude
(I didn't check if the last notation works, but it should).
Where land is the landscape object,
temp_pos is the coordinate (of XZ plane) you want to check (you are supposed
to not use landscapes higher than 10000 units...).
For normal calculation things are slightly more complicate (even if it's
just another line of trig formulae).
Jrg.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Done.
Thank you for the suggestion!
jrg.
Post a reply to this message
Attachments:
Download 'clutter5.jpg' (69 KB)
Preview of image 'clutter5.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
You gotta animate that!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Yeah, I was thinking so too.
I'll try.
Jonathan
"Bill DeWitt" <bde### [at] cfl rr com> ha scritto nel messaggio
news:3b471ec2@news.povray.org...
>
> You gotta animate that!
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
...and here's how it looks with a heightfield.
2700 spikes and no probability map this time.
jrg.
Post a reply to this message
Attachments:
Download 'clutter6.jpg' (134 KB)
Preview of image 'clutter6.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Oh good lord. It *is* now a VERY COOL macro... how
about object orientation parameters, possible to add in
or not?
-peter
--
http://www.users.qwest.net/~dearmad
Why bother? I'm not interesting.
But... maybe "Ballet pour ma fille" will be.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
this is starting to look a little like fur or... I
dunno something sort of wicked... :o)
-peter
--
http://www.users.qwest.net/~dearmad
Why bother? I'm not interesting.
But... maybe "Ballet pour ma fille" will be.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"JRG" <jrg### [at] hotmail com> wrote in message
news:3b474200@news.povray.org...
> ...and here's how it looks with a heightfield.
> 2700 spikes and no probability map this time.
Ok, this is cool and all, but it looks like your normal orientation is
reading one point only. In a situation like this, it might be nice if it
were able to average the normals in the local area. that way they would all
seem to stick out of the ground at what we perceive as the general tilt of
the ground in that area.
Just an idea...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
you're probably right. In fact objects have to be a lot smaller than the
landscape itself in order to get good results.
This macro is going beyond my own aspectatives (I just wanted to randomly
place objects on a plane), but now I feel I have to go further.
How many normals vectors you think I should average?
Jonathan.
"Bill DeWitt" <bde### [at] cfl rr com> ha scritto nel messaggio
news:3b474501$1@news.povray.org...
>
> "JRG" <jrg### [at] hotmail com> wrote in message
> news:3b474200@news.povray.org...
> > ...and here's how it looks with a heightfield.
> > 2700 spikes and no probability map this time.
>
> Ok, this is cool and all, but it looks like your normal orientation is
> reading one point only. In a situation like this, it might be nice if it
> were able to average the normals in the local area. that way they would
all
> seem to stick out of the ground at what we perceive as the general tilt of
> the ground in that area.
>
> Just an idea...
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"JRG" <jrg### [at] hotmail com> wrote :
>
> How many normals vectors you think I should average?
The radius of the object plus 10% or one ring of triangles around the
object?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Bill DeWitt wrote:
>
> "JRG" <jrg### [at] hotmail com> wrote :
> >
> > How many normals vectors you think I should average?
>
> The radius of the object plus 10% or one ring of triangles around the
> object?
A central point and a ring of six you mean? They should probably be
weighted less the farther away. For overkill you could do another ring
of twelve around that...
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"David Fontaine" <dav### [at] faricy net> wrote :
>
> A central point and a ring of six you mean? They should probably be
> weighted less the farther away. For overkill you could do another ring
> of twelve around that...
Well, thinking about it (and admitting that I have no skill at such
things) it would seem that the radius of the object would normally be
enough. If the object is unusually shaped it might be a problem, but for the
most part, if you place an object on an irregular surface, the points where
it touches are what determine the orientation, not the point under the
center.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Sat, 7 Jul 2001 14:29:53 +0200, JRG wrote:
>If you want to know the y coordinate of a point (i.e. its height):
>
>#local _alt=vdot(y,trace( land, temp_pos+10000*y,-y)); // check the
>altitude
>
>or, even easier:
>
>#local _alt=(trace( land, temp_pos+10000*y,-y)).y; // check the altitude
>
>(I didn't check if the last notation works, but it should).
>
>Where land is the landscape object,
>temp_pos is the coordinate (of XZ plane) you want to check (you are supposed
>to not use landscapes higher than 10000 units...).
>
>For normal calculation things are slightly more complicate (even if it's
>just another line of trig formulae).
You shouldn't need another line of trig. You should be able to do:
#local _norm = <0,0,0>;
#local _alt=trace(land, temp_pos+10000*y,-y,_norm).y;
and find the normal at the intersection in the _norm vector (or <0,0,0> if
no intersection was found.)
--
#local R=<7084844682857967,0787982,826975826580>;#macro L(P)concat(#while(P)chr(
mod(P,100)),#local P=P/100;#end"")#end background{rgb 1}text{ttf L(R.x)L(R.y)0,0
translate<-.8,0,-1>}text{ttf L(R.x)L(R.z)0,0translate<-1.6,-.75,-1>}sphere{z/9e3
4/26/2001finish{reflection 1}}//ron.parker@povray.org My opinions, nobody else's
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Oh well, I did it. The trig formula is used when rotating the object. But
I've not got any problem with it.
jrg.
"Ron Parker" <ron### [at] povray org> ha scritto nel messaggio
news:slr### [at] fwi com...
> On Sat, 7 Jul 2001 14:29:53 +0200, JRG wrote:
> >If you want to know the y coordinate of a point (i.e. its height):
> >
> >#local _alt=vdot(y,trace( land, temp_pos+10000*y,-y)); // check the
> >altitude
> >
> >or, even easier:
> >
> >#local _alt=(trace( land, temp_pos+10000*y,-y)).y; // check the altitude
> >
> >(I didn't check if the last notation works, but it should).
> >
> >Where land is the landscape object,
> >temp_pos is the coordinate (of XZ plane) you want to check (you are
supposed
> >to not use landscapes higher than 10000 units...).
> >
> >For normal calculation things are slightly more complicate (even if it's
> >just another line of trig formulae).
>
> You shouldn't need another line of trig. You should be able to do:
>
> #local _norm = <0,0,0>;
> #local _alt=trace(land, temp_pos+10000*y,-y,_norm).y;
>
> and find the normal at the intersection in the _norm vector (or <0,0,0> if
> no intersection was found.)
>
> --
> #local R=<7084844682857967,0787982,826975826580>;#macro
L(P)concat(#while(P)chr(
> mod(P,100)),#local P=P/100;#end"")#end background{rgb 1}text{ttf
L(R.x)L(R.y)0,0
> translate<-.8,0,-1>}text{ttf
L(R.x)L(R.z)0,0translate<-1.6,-.75,-1>}sphere{z/9e3
> 4/26/2001finish{reflection 1}}//ron.parker@povray.org My opinions, nobody
else's
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Bill DeWitt wrote:
>
> Well, thinking about it (and admitting that I have no skill at such
> things) it would seem that the radius of the object would normally be
> enough. If the object is unusually shaped it might be a problem, but for the
> most part, if you place an object on an irregular surface, the points where
> it touches are what determine the orientation, not the point under the
> center.
Hmm, actually then, rather than averaging normals, it would probably be
better to actually use the plane that goes through or best fits the
points around the edge. With three points it's simple vcross
calculations, with six you could probably just use two interlaced sets
of three and average them.
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |