POV-Ray : Newsgroups : povray.general : Large field of grass Server Time
4 Aug 2024 14:26:20 EDT (-0400)
  Large field of grass (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: StephenS
Subject: Re: Large field of grass
Date: 12 Feb 2012 16:30:01
Message: <web.4f382e4655dd79fd23099c9e0@news.povray.org>
"davidafisher" <dav### [at] coppernet> wrote:
....
>  CenS     = 197610.0310786000, 11.1000000000, -695109.5844980000
>
>  my plan was to radiate out from this spot and place grass patches to help in
> the depth of field. As you can see from the x,z coordinates using <0,0,0> as a
> trace point would not work (glancing blow or some other part of the topography
> might intercede), so I set two points one above and one below the terrain by
> adding and subtracting 50 to the y coordinate.
>
>    new_up = 197610.0310786000, 61.1000000000, -695109.5844980000
>
>  new_down = 197610.0310786000, -38.9000000000, -695109.5844980000
> run the trace
> #local clump_position  =  trace (landmass,new_up, new_down,TraceNorm);
>
> as a test trace between these two points you would think I would get the
> original CenS value, but this is what I get:
>
>  TraceNorm      = -0.0852216709,  0.9928279034,  0.0838452206
>  clump_position = 198132.9729394691, 60.9970576631, -696949.0756293016
>
> a difference in x of 522.9418609 and z of -1839.491131
>
> What is it that I don't understand about trace?

trace() uses a direction vector <0,-1,0>, for example.

trace(Object_identifier, Start_point, Direction, Vector_ident)

Stephen S


Post a reply to this message

From: Robert McGregor
Subject: Re: Large field of grass
Date: 13 Feb 2012 11:10:00
Message: <web.4f39358055dd79fd94d713cc0@news.povray.org>
"davidafisher" <dav### [at] coppernet> wrote:
> I followed the trace() advice and ran into a problem. I use an ordnance Survey
> digital map for my topography and have a GPS location that coincides with the
> Landmass, this location is set for the center of my scene:
>
>  CenS     = 197610.0310786000, 11.1000000000, -695109.5844980000
>
>  my plan was to radiate out from this spot and place grass patches to help in
> the depth of field. As you can see from the x,z coordinates using <0,0,0> as a
> trace point would not work (glancing blow or some other part of the topography
> might intercede), so I set two points one above and one below the terrain by
> adding and subtracting 50 to the y coordinate.
>
>    new_up = 197610.0310786000, 61.1000000000, -695109.5844980000
>
>  new_down = 197610.0310786000, -38.9000000000, -695109.5844980000
> run the trace
> #local clump_position  =  trace (landmass,new_up, new_down,TraceNorm);
>
> as a test trace between these two points you would think I would get the
> original CenS value, but this is what I get:
>
>  TraceNorm      = -0.0852216709,  0.9928279034,  0.0838452206
>  clump_position = 198132.9729394691, 60.9970576631, -696949.0756293016
>
> a difference in x of 522.9418609 and z of -1839.491131
>
> What is it that I don't understand about trace?

If you just set the y coordinate of the from vector somewhere high above the
terrain and trace it down using -y the clump_position will be the location on
the terrain surface, and TraceNorm will be the surface normal for reorienting
the clump appropriately via Reorient_Trans, then you can translate the clump
into position, something like:

#local new_up = <197610, 10000000, -695109>;
#local clump_position = trace(landmass, new_up, -y, TraceNorm);

object { clump
   Reorient_Trans(y, TraceNorm)
   translate clump_position
}
-------------------------------------------------
www.McGregorFineArt.com


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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