POV-Ray : Newsgroups : povray.newusers : Hi! Needin' some help with some stuff. : Hi! Needin' some help with some stuff. Server Time
5 Jul 2024 04:38:45 EDT (-0400)
  Hi! Needin' some help with some stuff.  
From: MCC900
Date: 3 Jul 2010 17:40:01
Message: <web.4c2fad24f2f5e7f51a3c3c2c0@news.povray.org>
Hello!
I'm MCC900, 17 years old, born and living in Uruguay, South America.
I'm completely new at povray (well, not new, but I have very little experience
with it).

I need some help with a couple of things...
See, I'm highly interested in vegetation simulation using pov, and I've seen
some amazing examples out there...
Like Tom's Trees (http://www.aust-manufaktur.de/austt.html) or Norbert Kern's
vegetation simulation
(http://news.povray.org/povray.binaries.images/thread/%3Cweb.44b62d56a7a9ea94c436b710@news.povray.org%3E/).
About the second one, I'm interested on knowing how did Norbert manage to get
the vegetation adjust to the height field...
I just can't find the download link for it so I can't know how does the source
code works.
See, for adjusting the grass/plants to the height field, I was thinking in
getting the color of each pixel of the height field's base image...
Is that possible? Getting the color data of a determinated pixel in an image?
Well, anyway, I also need help with a very basic grass generator I've made...
Here's the code:

//Camera Settings
camera{location <0,0.2,0.1>
look_at <0,0,0.4>}


//Light Sources
light_source {
   <0, 1, -3> color rgb<1,1,1>
}

//Ground
plane {y,0 pigment{rgb<0.2,1,0.2>}}

//Single Grass
#declare single_strand =
polygon { 11,
<-9,0>,<-6,30>,<0,60>,<8,83>,<18,97>,<14,90>,<9,77>,<3,40>,<3,18>,<5,0>,<-9,0>
scale 0.00025
}

//Generate Grass Extension
#declare R = seed (124573);
#declare zStart = 0;
#declare zEnd = 1.5;
#declare xStart = -1;
#declare xEnd = 1;
#declare i = zStart;
#declare j = xStart;
#while (i < zEnd)
#while (j < xEnd)
#declare C = rand(R);
#object{single_strand
rotate <0,rand(R)*360,0>
scale <rand(R)*0.5+0.5,rand(R)*0.3+0.7,1>
translate j*x
translate i*z
pigment{rgb<C/3,C*0.5+0.5,C/3>}
}
#declare j = j + 0.0025;
#end
#declare i = i +0.0025;
#declare j = xStart;
#end

It works pretty well (yeah, I know the grass look is very far away from real
grass) but the thing is, that if I want to make a big extension of field with
grass using this code, the parsing takes a lot of memory and the program lags...
I know there should be away to reduce the parsing memory, even if the redering
takes an entire day...
I have the feeling that I shouldn't be using while loops.
Thanks a lot for your time!


Post a reply to this message

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