POV-Ray : Newsgroups : povray.general : How to put image on one side of an object Server Time
21 Dec 2024 10:52:36 EST (-0500)
  How to put image on one side of an object (Message 1 to 7 of 7)  
From: Kima
Subject: How to put image on one side of an object
Date: 4 Aug 2019 15:00:00
Message: <web.5d472a1215d15201ecc0fada0@news.povray.org>
Consider a simple cube as

superellipsoid{ <.25,0.25>
  texture{ pigment{ color rgb<0.65,1,0.1>}
           finish { phong 1}
         }

I put an image on its surface as


superellipsoid{ <.25,0.25>
  texture{ pigment{

 image_map{ png "ad.png"
            map_type 0
            interpolate 2
            once
          }

}
           finish { phong 1}
         }

}

I have two problems:

1. How can I keep the pigment color underneath to have a closed where has not
been wrapped by the image?

2. Wrapping starts from the left corner of the object, and I lose the curvature
on the left side, but it is OK on the right side. According to
http://www.f-lohmueller.de/pov_tut/backgrnd/p_sky9.htm the image covers +Z and
goes to +X. Is it possible to put the image on the center of +Z to let the
excess image covers both -X and +X?


Post a reply to this message

From: William F Pokorny
Subject: Re: How to put image on one side of an object
Date: 5 Aug 2019 07:58:18
Message: <5d4819da$1@news.povray.org>
On 8/4/19 2:55 PM, Kima wrote:
> Consider a simple cube as
> 
> I have two problems:
> 
> 1. How can I keep the pigment color underneath to have a closed where has not
> been wrapped by the image?
> 
> 2. Wrapping starts from the left corner of the object, and I lose the curvature
> on the left side, but it is OK on the right side. According to
> http://www.f-lohmueller.de/pov_tut/backgrnd/p_sky9.htm the image covers +Z and
> goes to +X. Is it possible to put the image on the center of +Z to let the
> excess image covers both -X and +X?
> 

If I'm understanding your questions,

With (1) the object pattern is perhaps one way where you use another 
unseen/defined-only object along with a second solid color texture to 
limit where the image_map texture is applied.

With (2) move the image_map using translate <-0.5,-0.5,0>. You'll likely 
still not get the ideal map to the curvature for the superellipsoid at 
the corners. I don't know how to easily correct for that distortion.

Aside: For some shapes there is the shape uv_mapping mechanism(1), but 
as I recall the superellipsoid isn't supported. Further, there are today 
general issues with it even for shapes where it is implemented.

A question bouncing around in my head is whether with the new 
user_defined camera there isn't some way we can implement a more general 
3D point to shape mapping mechanism. I have a crude version of the idea 
going in my density file patch branch. It's how the warps of the posted 
maze images warped both the iso-surface shape and it's texture(s) 
together. Not sure though how to do the point to surface association and 
interpolation generally for any shape including csg - but that's sort of 
the thought.

Bill P.

(1) - Not here speaking of the image_map or warp type mapping.


Post a reply to this message

From: Le Forgeron
Subject: Re: How to put image on one side of an object
Date: 5 Aug 2019 13:18:55
Message: <5d4864ff$1@news.povray.org>
Le 04/08/2019 à 20:55, Kima a écrit :
> Consider a simple cube as
> 
> superellipsoid{ <.25,0.25>
>   texture{ pigment{ color rgb<0.65,1,0.1>}
>            finish { phong 1}
>          }
> 
> I put an image on its surface as
> 
> 
> superellipsoid{ <.25,0.25>
>   texture{ pigment{
> 
>  image_map{ png "ad.png"
>             map_type 0
>             interpolate 2
>             once
>           }
> 
> }
>            finish { phong 1}
>          }
> 
> }
> 
> I have two problems:
> 
> 1. How can I keep the pigment color underneath to have a closed where has not
> been wrapped by the image?
> 
> 2. Wrapping starts from the left corner of the object, and I lose the curvature
> on the left side, but it is OK on the right side. According to
> http://www.f-lohmueller.de/pov_tut/backgrnd/p_sky9.htm the image covers +Z and
> goes to +X. Is it possible to put the image on the center of +Z to let the
> excess image covers both -X and +X?
> 
> 

what about using a "warp{ cubic }" ?

http://wiki.povray.org/content/Reference:Warp#Mapping_using_warps


Post a reply to this message

From: Bald Eagle
Subject: Re: How to put image on one side of an object
Date: 5 Aug 2019 14:30:00
Message: <web.5d4874936a1acee94eec112d0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> what about using a "warp{ cubic }" ?
>
> http://wiki.povray.org/content/Reference:Warp#Mapping_using_warps

I must admit, that I have never used this, neither can I find a graphical
example of what it looks like.

I'm also presuming that it's different from the cubic pigment pattern
http://news.povray.org/povray.binaries.images/thread/%3C5a66fe3d%241%40news.povray.org%3E/

Given the fact that I've been investigating and experimenting more with
functions and patterns, this also makes me wonder how hard it would be to make a
superellipsoid warp.

http://povray.org/documentation/view/3.6.1/285/

Based upon a cursory reading of this (pg 19):
https://cse.buffalo.edu/~jryde/cse673/files/superquadrics.pdf

It seems to me that perhaps a modification of the spherical warp might be the
way to go?


Post a reply to this message

From: Bald Eagle
Subject: Re: How to put image on one side of an object
Date: 5 Aug 2019 14:40:01
Message: <web.5d4877076a1acee94eec112d0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Given the fact that I've been investigating and experimenting more with
> functions and patterns, this also makes me wonder how hard it would be to make a
> superellipsoid warp.


Placing this here for future investigation:

https://github.com/baonguyen84/SuperQuadric-Webgl

"This program is a html file using WebGL, built on JavaScript that first build a
surface of of superellipsoid. .... Finally the program will map a 2D texture, by
dividing up the mesh into "slices and dices", map an image to the corresponding
point on the surface of the mesh...."


Post a reply to this message

From: Bald Eagle
Subject: Re: How to put image on one side of an object
Date: 5 Aug 2019 14:50:00
Message: <web.5d48799a6a1acee94eec112d0@news.povray.org>
Placing this here as well for future investigation:

https://cs-people.bu.edu/sbargal/Fall%202016/lecture_notes/Nov_3_3d_geometry_representation


(page 20)

If it has a parametric equation based on u and v, is it then not inherently
uv-mappable?


Post a reply to this message

From: Bald Eagle
Subject: Re: How to put image on one side of an object
Date: 5 Aug 2019 16:15:00
Message: <web.5d488d916a1acee94eec112d0@news.povray.org>
And

(1) since this appears to be a _fait accompli_ in 1998,
https://www.academia.edu/10284037/Surface_subdivision_for_generating_superquadrics
(2) it would be educational for many people to see the mechanism of how
uv-mapping is applied to a shape,
and
(3) isosurfaces and parametrics can be a real bear to even get to display
properly,


Perhaps we can open up a new thread on uv mapping Superquadrics, with a suitable
test scene in SDL, and a
pigment {function(x,y,z, RX, RY, RZ, E1, E2){Equation}}
can be defined to texture the surface of the object.

At the moment, I can't get the parametric to give me anything but a completely
black box even with an emissive red texture, and my isosurface doesn't even show
up :(

Ray->Shape Intersection          Tests       Succeeded  Percentage
----------------------------------------------------------------------------
Isosurface                      262203               0      0.00
Isosurface Container            262257          262257    100.00
Isosurface Cache                189211           32172     17.00


Post a reply to this message

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