POV-Ray : Newsgroups : povray.binaries.images : Heightfield with road Server Time
2 Aug 2024 18:10:13 EDT (-0400)
  Heightfield with road (Message 8 to 17 of 17)  
<<< Previous 7 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: Heightfield with road
Date: 21 Jun 2007 19:03:58
Message: <467b03de@news.povray.org>
SharkD nous apporta ses lumieres en ce 2007/06/21 03:54:
> I've created a scene with a heightfield. I want to place a road over the
> heightfield. I created a macro to generate a spline-shaped road that is
> interpolated through points on the heightfield. The problem is that the
> road cuts into (or floats over) the terrain depending on the slope of the
> terrain around it. I don't expect there's a way to fix this. The only thing
> I can think of is to modifiy the heightfield. Unfortunately, the resolution
> of my heightfield is not great enough to do this.
> 
> What do the professionals do when they are facing similar problems?
> 
> 
> ------------------------------------------------------------------------
> 
Start by cuting away the path of the road from the hight_field using a 
difference. You can use boxes, cylinders, sphere_sweep, or a collection of 
prism. This will solve the buried road problem.
Give some thickness to your road, or give it some foundation. This will solve 
the floating road problem.

The suggestion from Rarius can work but will be very slow, due to bounding 
ineficiency when differencing. If you go that way, it may be worth it to use 
merge instead of union (you remove 1 merge instead of each individual union 
object), or set split_union off (on by default).

-- 
Alain
-------------------------------------------------
AI programmers only think they do it


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Heightfield with road
Date: 21 Jun 2007 19:22:12
Message: <467b0824$1@news.povray.org>
SharkD wrote:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
> 
>>If your road doesn't need to be elevated over the terrain,
>>you could just layer a road texture on top.
> 
> Yes, but this would require large images, and I'm already running out of
> memory as it is.

I was thinking more of a function pattern based on your road spline.
Alternatively, you can make a thick road object and intersect it
with the hf to get the road geometry.


Post a reply to this message

From: SharkD
Subject: Re: Heightfield with road
Date: 21 Jun 2007 21:40:02
Message: <web.467b274435b0b288877afef70@news.povray.org>
I opted to just use an image map for the road. At this scale it doesn't look
too bad.

The source image for the road is 4096x4096 pixels and 250MB in Photoshop! (I
needed to use Photoshop in order to draw on a new layer on top of an
overhead view of the heightfield.)

Christian Froeschlin <chr### [at] chrfrde> wrote:
> SharkD wrote:
> > Christian Froeschlin <chr### [at] chrfrde> wrote:
> >
> >>If your road doesn't need to be elevated over the terrain,
> >>you could just layer a road texture on top.
> >
> > Yes, but this would require large images, and I'm already running out of
> > memory as it is.
>
> I was thinking more of a function pattern based on your road spline.
> Alternatively, you can make a thick road object and intersect it
> with the hf to get the road geometry.


Post a reply to this message


Attachments:
Download 'outdoorscene_b.jpg' (71 KB)

Preview of image 'outdoorscene_b.jpg'
outdoorscene_b.jpg


 

From: John VanSickle
Subject: Re: Heightfield with road
Date: 22 Jun 2007 15:44:00
Message: <467c2680@news.povray.org>
SharkD wrote:
> I've created a scene with a heightfield. I want to place a road over the
> heightfield. I created a macro to generate a spline-shaped road that is
> interpolated through points on the heightfield. The problem is that the
> road cuts into (or floats over) the terrain depending on the slope of the
> terrain around it. I don't expect there's a way to fix this. The only thing
> I can think of is to modifiy the heightfield. Unfortunately, the resolution
> of my heightfield is not great enough to do this.
> 
> What do the professionals do when they are facing similar problems?

Build a long, skinny mound that runs along the roadway.  Texture the 
bottom like the grass of the HF, and the top like the roadway.  Make it 
slope gently away from the road so that it looks like a natural part of 
the HF.

Regards,
John


Post a reply to this message

From: SharkD
Subject: Re: Heightfield with road
Date: 22 Jun 2007 22:20:02
Message: <web.467c834435b0b28870b838070@news.povray.org>
Differencing will be a problem due to the fact that the heightfield is a
polygon-based object, and therefore has no inside. You'll be able to see
through the hole to the underside of the heightfield.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Heightfield with road
Date: 23 Jun 2007 03:55:36
Message: <467cd1f8@news.povray.org>
"SharkD" <nomail@nomail> schreef in bericht 
news:web.467c834435b0b28870b838070@news.povray.org...
> Differencing will be a problem due to the fact that the heightfield is a
> polygon-based object, and therefore has no inside. You'll be able to see
> through the hole to the underside of the heightfield.
>
>
No. You can difference a cube or whatever from a height_field. The 
differenced part will show as a negative image of the cube. See the attached 
image (quick-and-dirty) made in Moray.

Thomas


Post a reply to this message


Attachments:
Download 'hf_differencetest.jpg' (77 KB)

Preview of image 'hf_differencetest.jpg'
hf_differencetest.jpg


 

From: Marc
Subject: Re: Heightfield with road
Date: 23 Jun 2007 04:26:49
Message: <467cd949$1@news.povray.org>

web.467c834435b0b28870b838070@news.povray.org...
> Differencing will be a problem due to the fact that the heightfield is a
> polygon-based object, and therefore has no inside. You'll be able to see
> through the hole to the underside of the heightfield.
>

As says Thomas, it works. A heighfield has an inside.
It is easy for pov to find it as the heightfield has no overhanging.
It is the same section as the heightfield, and is infinite in the -y 
direction (before any tranformation of course)

Marc


Post a reply to this message

From: SharkD
Subject: Re: Heightfield with road
Date: 23 Jun 2007 13:30:02
Message: <web.467d582b35b0b2889ecc95aa0@news.povray.org>
Here's what I did:

1) I enlarged the heightfield source image. I did this by rendering an
overhead orthographic view of just the heightfield with a y-axis, black to
white ambient gradient pigment and no light source.
2) I changed the spline object's (the road's) pigment to a y-axis gradient
from black to white. I then rendered the scene from an overhead
orthographic view with the same dimensions as the new heightfield image
(alpha is turned on, so there's no other stuff in the scene). In this way,
I have generated a new heightfield that conforms to the road surface and
nothing else.
3) I combined the two images in Photoshop. The result is a new terrain
heightfield that doesn't float above or below the road surface.


Post a reply to this message


Attachments:
Download 'outdoorscene_h.jpg' (69 KB)

Preview of image 'outdoorscene_h.jpg'
outdoorscene_h.jpg


 

From: SharkD
Subject: Re: Heightfield with road
Date: 24 Jun 2007 13:10:01
Message: <web.467ea4fc35b0b288f62948820@news.povray.org>
I rendered the scene again, with the following slope map for the terrain:

 slope {-y}
 color_map
 {
  [0 color rgb <046/255,104/255,058/255,>]
  [0.0625 color rgb <139/255,117/255,102/255,>]
  [0.0625 color Gray]
  [0.125 color Gray]
 }

The problem areas are around the road where the terrain is particularly
steep. They are nearly vertical. They should be completely gray. Why isn't
the slope map being applied properly to these areas?


Post a reply to this message


Attachments:
Download 'outdoorscene.jpg' (36 KB)

Preview of image 'outdoorscene.jpg'
outdoorscene.jpg


 

From: Alain
Subject: Re: Heightfield with road
Date: 25 Jun 2007 07:55:17
Message: <467fad25@news.povray.org>
SharkD nous apporta ses lumieres en ce 2007/06/24 13:08:
> I rendered the scene again, with the following slope map for the terrain:
> 
>  slope {-y}
>  color_map
>  {
>   [0 color rgb <046/255,104/255,058/255,>]
>   [0.0625 color rgb <139/255,117/255,102/255,>]
>   [0.0625 color Gray]
>   [0.125 color Gray]
>  }
> 
> The problem areas are around the road where the terrain is particularly
> steep. They are nearly vertical. They should be completely gray. Why isn't
> the slope map being applied properly to these areas?
> 
> 
> 
> ------------------------------------------------------------------------
> 
...and the flat areas are gray.
Change the color_map as follow as a test:
[0.05 color Gray]
[0.06 color rgb <139/255,117/255,102/255>]
[0.1 color rgb <046/255,104/255,058/255>

-- 
Alain
-------------------------------------------------



Post a reply to this message

<<< Previous 7 Messages Goto Initial 10 Messages

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