POV-Ray : Newsgroups : povray.advanced-users : Generate HTML map areas for contours of objects Server Time
8 Jul 2024 18:39:28 EDT (-0400)
  Generate HTML map areas for contours of objects (Message 1 to 4 of 4)  
From: Pander
Subject: Generate HTML map areas for contours of objects
Date: 11 Sep 2006 16:30:01
Message: <web.4505c5a1afd260f1313368bc0@news.povray.org>
This is a feature request to have functionality in povray (or an external
tool employing porvay) to generate a HTML map that contains areas that are
masks for object contours. This would look like:

<map name=''>
  <area href='' shape='rect' coords='10,20,30,40'/>
  <area href='' shape='circle' coords='50,60,5'/>
  <area href='' shape='poly' coords='80,90,100,110,120,130,140,150'/>
</map>

This would need a very simple one bit countour trace per (specified or
specified type of) object and approximate the resulting contour by a rect,
circle or poly. Off course overlapping objects will each have thier own
contour where hidden parts, because of overlapping, will not be included in
the resulting map area.

Areas will not overlap and perhaps a configurable minimum distance between
them in pixels should be possible. Furthermore these areas may be a bit
crude and not pixel perfect.

Implementing this feature will result in easier use of clickable povray
generated images in HTML. This is because, for this image, the map areas
are already at hand and only have to be completed with href content.


Post a reply to this message

From: Le Forgeron
Subject: Re: Generate HTML map areas for contours of objects
Date: 12 Sep 2006 02:43:12
Message: <45065700@news.povray.org>
Pander scripsit::
> 
> This is a feature request to have functionality in povray (or an external
> tool employing porvay) to generate a HTML map that contains areas that are
> masks for object contours. This would look like:
> 
> <map name=''>
>   <area href='' shape='rect' coords='10,20,30,40'/>
>   <area href='' shape='circle' coords='50,60,5'/>
>   <area href='' shape='poly' coords='80,90,100,110,120,130,140,150'/>
> </map>
> 
> This would need a very simple one bit countour trace per (specified or
> specified type of) object and approximate the resulting contour by a rect,
> circle or poly. Off course overlapping objects will each have thier own
> contour where hidden parts, because of overlapping, will not be included in
> the resulting map area.

Even if tracing pixel per pixel is the easiest way, the NP problem
is the aggregation of same object pixel into a shape.
So, apart from the huge list of individual pixel map, there might be
no easy solution. Notice that overlapping is not a problem, because
it would be a first-hit-first-reported strategy. You might even
considere using antialiasing buffer technique to have an unmapped
pixel between different URL...

I'm really against this kind of evolution for PovRay: it has nothing
to do with 3D nor rendering. You could very well use some 2D graphic
programs with some "magic selection tool" to create your map.

Moreover, if you really intend to have a dynamic 3D image with map,
then I would recommand using VRML.


> 
> Areas will not overlap and perhaps a configurable minimum distance between
> them in pixels should be possible. Furthermore these areas may be a bit
> crude and not pixel perfect.
> 

You could as well render your picture with a smaller resolution and
use the zoomed thumbnail for the map...

> Implementing this feature will result in easier use of clickable povray
> generated images in HTML. This is because, for this image, the map areas
> are already at hand and only have to be completed with href content.
> 

Well, if the href is not even present in the output, you're
doomed... better do it with a 2D photo-program... it's simpler, really!


-- 
Eifersucht ist die Leidenschaft, die mit Eifer sucht, was Leiden
schafft.

Eco: -8.75 Soc: -6.72
http://www.politicalcompass.org/


Post a reply to this message

From: Mike Williams
Subject: Re: Generate HTML map areas for contours of objects
Date: 12 Sep 2006 04:20:44
Message: <tRj4rNA3vmBFFwjl@econym.demon.co.uk>
Wasn't it Le Forgeron who wrote:
>Pander scripsit::
>> 
>> This is a feature request to have functionality in povray (or an external
>> tool employing porvay) to generate a HTML map that contains areas that are
>> masks for object contours. This would look like:
>> 
>> <map name=''>
>>   <area href='' shape='rect' coords='10,20,30,40'/>
>>   <area href='' shape='circle' coords='50,60,5'/>
>>   <area href='' shape='poly' coords='80,90,100,110,120,130,140,150'/>
>> </map>
>> 
>> This would need a very simple one bit countour trace per (specified or
>> specified type of) object and approximate the resulting contour by a rect,
>> circle or poly. Off course overlapping objects will each have thier own
>> contour where hidden parts, because of overlapping, will not be included in
>> the resulting map area.
>
>Even if tracing pixel per pixel is the easiest way, the NP problem
>is the aggregation of same object pixel into a shape.

It may not be necessary to do sophisticated aggregation. Modern browsers
are capable of handling huge numbers of separate elements. I've not seen
it done with imagemap components, but I've seen pages that use thousands
of small rectangular clickable <div>s, many of them single pixels, and
they're blindingly fast.

The downside is that the information would be quite large. On the pages
I mentioned above, the <div>s were generated in place in Javascript, and
was blindingly fast, but for this purpose the information would need to
be loaded from the website, and therefore slow down the page loading.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: Generate HTML map areas for contours of objects
Date: 12 Sep 2006 04:23:38
Message: <8B78vTAW5mBFFwgX@econym.demon.co.uk>
Wasn't it Pander who wrote:
>
>
>This is a feature request to have functionality in povray (or an external
>tool employing porvay) to generate a HTML map that contains areas that are
>masks for object contours. This would look like:

An alternative strategy to explore would be to generate a transparent
PNG mask to capture map clicks.

Use the +ua option to create a PNG file that is completely transparent
where no ray hits the target. Use a 2D image processing application to
reduce the opacity of the visible region from 100% to 1%. This results
in an image which is invisible to the user but visible to the browser's
click handler.

Place the transparent image on top of the normal image (remembering to
use AlphaImageLoader if the browser is MSIE with version less than 7),
but make only the transparent image clickable. When the user clicks on a
pixel where the mask is 100% transparent, the click falls through and
the onclick action is not performed. When the user clicks on a pixel
which has 1% opacity, the click is captured and the onclick function is
performed.

I don't know how browser independent this technique is.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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