![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I have a hf created with an isosurface. I want to place grass on it - easy
BUT I only want to place grass on the sides of the hills facing the camera.
How can I test to see which slopes are facing me and which are hidden.
Mick
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mick Hazelgrove <mic### [at] mhazelgrove fsnet co uk> schrieb in im Newsbeitrag:
3b46f9ad@news.povray.org...
> I have a hf created with an isosurface. I want to place grass on it -
easy
> BUT I only want to place grass on the sides of the hills facing the
camera.
> How can I test to see which slopes are facing me and which are hidden.
>
> Mick
You could use an orthographic camera,
and look down on the hf.
Give the hf a white texture with ambient 0 and place one
light there where your camera should be in the final image.
You could use the resulting image to place the grass.
I don't know if this woks but I think it should.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mick Hazelgrove wrote:
>
> I have a hf created with an isosurface. I want to place grass on it - easy
> BUT I only want to place grass on the sides of the hills facing the camera.
> How can I test to see which slopes are facing me and which are hidden.
>
Just do a second trace against the camera location and leave out all
positions where this trace is successful. Of course this could be
problematic, since you probably want also some grass just below the
visibility line.
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Mick Hazelgrove" <mic### [at] mhazelgrove fsnet co uk> wrote:
> I have a hf created with an isosurface. I want to place grass on it -
> easy BUT I only want to place grass on the sides of the hills facing the
> camera. How can I test to see which slopes are facing me and which are
> hidden.
>
Trace the point, and compare the surface normal at the point to the
camera->point vector. If the angle between the two is greater than 90
degrees, the surface is facing away from the camera. You might also want to
include points just below the horizon, i.e. points where the angle is a bit
more than 90 degrees. Example:
//CamPos: camera location
//TestPos: traced point on the HF
//N: surface normal at the point
//MaxAngle: 90 is at the horizon, >90 is beyond the horizon
#declare CamDir=vnormalize(TestPos-CamPos);
#if(vdot(CamDir,N)>cos(radians(MaxAngle)))
//put grass here
#end
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Home page http://www.hot.ee/margusrt
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thanks
This seems to be what I want, I've been close but didn't take into account
the camera position!
Thanks again
Mick
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> #declare CamDir=vnormalize(TestPos-CamPos);
> #if(vdot(CamDir,N)>cos(radians(MaxAngle)))
> //put grass here
> #end
BTW shouldn't that be
#if(vdot(CamDir,N)<cos(radians(MaxAngle))) ?
Mick
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mick Hazelgrove wrote:
>
> BTW shouldn't that be
>
> #if(vdot(CamDir,N)<cos(radians(MaxAngle))) ?
Right, sorry. Bear in mind though that with this <90 degrees faces away
from you. To make it work the way I described (personally, I find that
more intuitive), the correct version is:
#if(vdot(CamDir,-N)>cos(radians(MaxAngle)))
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Home page http://www.hot.ee/margusrt
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |