POV-Ray : Newsgroups : povray.newusers : image_map > solid object Server Time
15 Jul 2024 07:03:39 EDT (-0400)
  image_map > solid object (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: Bill Pragnell
Subject: Re: image_map > solid object
Date: 3 May 2016 10:15:00
Message: <web.5728b1a22da27c235b7d07940@news.povray.org>
"Paul" <nomail@nomail> wrote:
> I need a solid object, the 2 surfaces joined - the transparent yellow things > on
the right side.

Where do your images come from? If they were generated by a vector drawing
program you may be able to do it another way. Inkscape (https://inkscape.org/)
can export paths as POV-Ray prism objects, which would do exactly what you want.

If you only have the images, it may still be possible to use Inkscape to trace
over the images, creating equivalent paths that could then be exported.

Bill


Post a reply to this message

From: Alain
Subject: Re: image_map > solid object
Date: 3 May 2016 10:27:45
Message: <5728b561$1@news.povray.org>

> Re-creating the image from scratch, using standard Pov-Ray objects, yes, that is
> an option.
> And the example image is pretty easy, simple shapes.
> But I have lots of other different images, more "artistic", not simple geometric
> shapes.
> So I'm looking for a universal solution, for any input image.
> I also used a simple 'for' to duplicate the object 10-15 times, but the quality
> is not that good (there are still empty spaces between objects) and the
> rendering time is too big (I'm rendring lots of frames, for animations).
> But, why aren't the resulting shapes solid, as far as I understoond from Pov-Ray
> help > all object are solid by default.
> If I do a simple 'difference' between 2 boxes > the result is indeed solid.
>
>
>
Solid don't mean opaque. A fully transparent object is solid, but you 
see through it.

In your case, I'd use a height_field using a black & white version of 
your image using water_level to clip the bottom part.
Next, use that height_field in an intersection with a box and apply your 
image to that. You'll need to rotate the image by 90*x or the 
intersection by -90*x so that they are oriented the same way.

It's probably the easiest and fastest way to proceed.



Alain


Post a reply to this message

From: clipka
Subject: Re: image_map > solid object
Date: 3 May 2016 10:29:31
Message: <5728b5cb$1@news.povray.org>
Am 03.05.2016 um 15:08 schrieb Paul:
> Re-creating the image from scratch, using standard Pov-Ray objects, yes, that is
> an option.
> And the example image is pretty easy, simple shapes.
> But I have lots of other different images, more "artistic", not simple geometric
> shapes.
> So I'm looking for a universal solution, for any input image.
> I also used a simple 'for' to duplicate the object 10-15 times, but the quality
> is not that good (there are still empty spaces between objects) and the
> rendering time is too big (I'm rendring lots of frames, for animations).
> But, why aren't the resulting shapes solid, as far as I understoond from Pov-Ray
> help > all object are solid by default.
> If I do a simple 'difference' between 2 boxes > the result is indeed solid.

There is probably a conceptual misunderstanding here.

In POV-Ray, you have to distinguish three different concepts:

- The *surface* of a geometric primitive: This set of points is defined
*exclusively* by what type of primitive it is, what the
primitive-specific parameters are set to, and how it is transformed
(translated, scaled or rotated).

- The *volume* of an geometric primitive: This set of points is also
defined *exclusively* by what type of primitive it is, what the
primitive-specific parameters are set to, and how it is transformed
(translated, scaled or rotated). (Usually this is the set of points
enveloped by the surface, although there are exceptions.)

- The *texture* of an object: This function of space is defined
*exclusively* by what pigment and finish you choose, and how you
transform them.

What POV-Ray actually displays is the *texture* at any *surface* that
meets certain constraints about being inside or outside other objects'
*volume* (as determined by CSG composition).

Your texture doesn't show up as 3-dimensional because there are no
surfaces in the bulk of the object. If you do a "difference" with
another object, you introduce another surface for the texture to be
displayed at.


(This is oversimplifying the situation a bit: There is also the concept
of media, which is somewhat like texture but can show up even between
surfaces; but that's always "foggy" in nature, and doesn't introduce new
surfaces.)


There is one way to turn functions of space into actual surfaces, and
that's the isosurface primitive: It takes a scalar function of space
(i.e. a function taking three coordinates and evaluating to a single
value) and defines surface and a volume based on where the function
evaluates to a given threshold.

In order to make use of this primitive type for your purpose, you need
to know that you can turn a pigment into a scalar function suitable for
an isosurface; for that you'll need a "pigment function". You'll also
need to know that a function used in an isosurface must not have any
discontinuities, so you need to activate interpolation on it.


Post a reply to this message

From: Paul
Subject: Re: image_map > solid object
Date: 3 May 2016 10:30:00
Message: <web.5728b4e32da27c23a09e82530@news.povray.org>
"Bill Pragnell" <bil### [at] hotmailcom> wrote:
> "Paul" <nomail@nomail> wrote:
> > I need a solid object, the 2 surfaces joined - the transparent yellow things > on
the right side.
>
> Where do your images come from? If they were generated by a vector drawing
> program you may be able to do it another way. Inkscape (https://inkscape.org/)
> can export paths as POV-Ray prism objects, which would do exactly what you want.
>
> If you only have the images, it may still be possible to use Inkscape to trace
> over the images, creating equivalent paths that could then be exported.
>
> Bill

Images are coming from clients.
No other formats are available, only PNG (if I'm lucky) or JPG.
I don't think tracing will work, probably not that good definition of resulting
objects.
Well, looks like this is one tricky operation, thank you for all your help.


Post a reply to this message

From: clipka
Subject: Re: image_map > solid object
Date: 3 May 2016 10:31:18
Message: <5728b636@news.povray.org>
Am 03.05.2016 um 15:41 schrieb Stephen:

> I would use CSG. The way I would try it is to use heightfields.

Height fields are pretty lame for this purpose, as they would create
very jagged sides.


Post a reply to this message

From: Alain
Subject: Re: image_map > solid object
Date: 3 May 2016 10:33:38
Message: <5728b6c2$1@news.povray.org>


>
> Like I said, this example PNG is very simple, 2 colors indeed.
> But I have others with many colors, more complicated shapes, not so easy to
> separate colors/shapes.
> Also, heightfield does not produce the quality I need, I used them a long time
> ago and they are not very smooth and sharp.
>
>

You can increase the resolution of the image used in the height_field to 
get smoother edges. Also, slightly bluring the inage used can help in 
this case.
To have sharper results, scale the hight_field verticaly by something 
like 100 (scale<1,100,1>), and clip it using a box of the desired height 
in an intersection.

Alain


Post a reply to this message

From: Kenneth
Subject: Re: image_map > solid object
Date: 3 May 2016 22:35:01
Message: <web.57295e912da27c2333c457550@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 03.05.2016 um 15:41 schrieb Stephen:
>
> > I would use CSG. The way I would try it is to use heightfields.
>
> Height fields are pretty lame for this purpose, as they would create
> very jagged sides.

That's generally true; but if your artwork is very 'clean' with sharp edges, a
height_field might work, as the HF's sides would be completely vertical. Not
perfect though, I admit, as the triangles on the sides can still be somewhat
visible, and not perfectly smooth.

Some years ago, I used *media* to try to get this effect (a method that Clipka
already mentioned.) The results were reasonably good (depending on how DENSE I
could make the scattering media.) But the code for doing it was quite complex--
involving the image's three RBG colors first being converted into three separate
functions...

If I can find my old POV-Ray file and/or image, I'll post it, to give you an
idea of what it looks like.


Post a reply to this message

From: Kenneth
Subject: Re: image_map > solid object
Date: 3 May 2016 22:55:01
Message: <web.572963922da27c2333c457550@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

>
> If I can find my old POV-Ray file and/or image, I'll post it, to give you an
> idea of what it looks like.

I found my original newsgroup post about this, which has some detail as to the
various tricks I used...

http://news.povray.org/povray.binaries.images/message/%3Cweb.4436e54a72fe66658ad7a9060%40news.povray.org%3E/#%3Cweb.443
6e54a72fe66658ad7a9060%40news.povray.org%3E

I think *your* artwork would probably look better than the 'dinosaur skeleton'
image I used there.


Post a reply to this message

From: Kenneth
Subject: Re: image_map > solid object
Date: 3 May 2016 23:15:00
Message: <web.572968232da27c2333c457550@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

>
> I found my original newsgroup post about this, which has some detail as to the
> various tricks I used...
>

Oops, sorry, that was just my initial post there. Here's the full discussion...

http://news.povray.org/povray.binaries.images/thread/%3Cweb.4436e54a72fe66658ad7a9060%40news.povray.org%3E/


Post a reply to this message

From: Le Forgeron
Subject: Re: image_map > solid object
Date: 4 May 2016 01:54:25
Message: <57298e91$1@news.povray.org>
Le 03/05/2016 16:25, Paul a écrit :
> "Bill Pragnell" <bil### [at] hotmailcom> wrote:
>> "Paul" <nomail@nomail> wrote:
>>> I need a solid object, the 2 surfaces joined - the transparent yellow things > on
the right side.
>>
>> Where do your images come from? If they were generated by a vector drawing
>> program you may be able to do it another way. Inkscape (https://inkscape.org/)
>> can export paths as POV-Ray prism objects, which would do exactly what you want.
>>
>> If you only have the images, it may still be possible to use Inkscape to trace
>> over the images, creating equivalent paths that could then be exported.
>>
>> Bill
>
> Images are coming from clients.
> No other formats are available, only PNG (if I'm lucky) or JPG.
> I don't think tracing will work, probably not that good definition of resulting
> objects.
> Well, looks like this is one tricky operation, thank you for all your help.
>
>
What you are trying to do is called "extrusion".

One additional solution to the ones already provided could be to convert 
the picture into a ttf font, one glyph per colour and then use povray 
text objects. (one text per colour).


There is a bit of utilities which can be useful in font-generation from 
pictures, and search engines are more verbose on that subject ("create 
font from picture")


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

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