POV-Ray : Newsgroups : povray.general : "best" way to create an shape covered with a picture? Server Time
18 Nov 2024 01:22:58 EST (-0500)
  "best" way to create an shape covered with a picture? (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: Jeff Kish
Subject: "best" way to create an shape covered with a picture?
Date: 18 Nov 2002 20:54:34
Message: <EJnZPbtpCghb5wuNusBXFxgV+kHg@4ax.com>
Greetings.

I am a beginner. I have gone through some tutorials for moray and
pov-ray. I have some pictures of my son I would like to map to a 3d
shape (shaped like his head of course).. what is the best way to do
this? I tried messing around with the pigment/image_map stuff, but
that looks like I am going the wrong way there.

Answers are good.. pointers to answers are appreciated. Heck, I'll
even take a flame if it answers my question!


Thanks
Jeff


Post a reply to this message

From: Warp
Subject: Re: "best" way to create an shape covered with a picture?
Date: 19 Nov 2002 05:26:23
Message: <3dda11cf@news.povray.org>
Jeff Kish <ELN/kishj@earthlink.net> wrote:
> I am a beginner. I have gone through some tutorials for moray and
> pov-ray. I have some pictures of my son I would like to map to a 3d
> shape (shaped like his head of course).. what is the best way to do
> this? I tried messing around with the pigment/image_map stuff, but
> that looks like I am going the wrong way there.

  If you are using a mesh to model your object, then uv-mapping gives you
the best freedom for assigning a pigment to it (you can tell for each vertex
point which point of the pigment is assigned to it).
  The problem with this is that it's next to impossible to write it by hand.
You'll need a modeller which supports uv-mapping in order to do this.
(I think there's a program called "uv-mapper" which has been praised).

  If your object consists of other primitives, then the issue is a lot
more complicated. If you want to apply an image map to this object, there's
basically no other way than using the few default mapping types (eg.
spherical).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Tom Melly
Subject: Re: "best" way to create an shape covered with a picture?
Date: 19 Nov 2002 05:36:52
Message: <3dda1444$1@news.povray.org>
"Jeff Kish" <ELN/kishj@earthlink.net> wrote in message
news:EJnZPbtpCghb5wuNusBXFxgV+kHg@4ax.com...
>
> Answers are good.. pointers to answers are appreciated. Heck, I'll
> even take a flame if it answers my question!

Hi Jeff, is the head a mesh or a blob/other?

Anyway, I would suggest you check the docs on spherical mapping - something
like:

#declare MyHead = sphere {0, 1}

object{
  MyHead
  pigment{
    image_map{ // see section 6.7.1.5.1
      sys
      "testsor.bmp"
      once // see section 6.7.12.7.1
      map_type 1
    }
  }
}

The main point/drawback is that map_type 1 maps the image using spherical
mapping - i.e. the above is ideal, mapping the image to a sphere. Because a head
isn't exactly spherical, you will get some distortion. If your head uses a mesh,
you would have the option of using UV mapping, but to be honest I've no idea how
you would go about this without deforming the image too much.


Post a reply to this message

From: Shay
Subject: Re: "best" way to create an shape covered with a picture?
Date: 19 Nov 2002 08:16:41
Message: <3dda39b9@news.povray.org>
"Jeff Kish" <ELN/kishj@earthlink.net> wrote in message
news:EJnZPbtpCghb5wuNusBXFxgV+kHg@4ax.com...

If you want to map an existing picture to a sphere, I think that map_type 2
(cylindrical) will give you more of the result you want.

This is untested:

sphere {
    0, 1
    pigment {
        image_map {sys "YourKid.bmp" map_type 2}
        translate <0,-0.5,0>
        scale <1,2,1>
    } // end pigment
} // end sphere

 -Shay


Post a reply to this message

From: Jeff Kish
Subject: Re: "best" way to create an shape covered with a picture?
Date: 19 Nov 2002 22:23:56
Message: <Bf3aPR=kEAXyhlkPJEGCFN5MWNSq@4ax.com>
On Tue, 19 Nov 2002 10:36:52 -0000, "Tom Melly" <tom### [at] tomandlucouk>
wrote:

>"Jeff Kish" <ELN/kishj@earthlink.net> wrote in message
>news:EJnZPbtpCghb5wuNusBXFxgV+kHg@4ax.com...
>>
>> Answers are good.. pointers to answers are appreciated. Heck, I'll
>> even take a flame if it answers my question!
>
>Hi Jeff, is the head a mesh or a blob/other?
>
>Anyway, I would suggest you check the docs on spherical mapping - something
>like:
>
>#declare MyHead = sphere {0, 1}
>
>object{
>  MyHead
>  pigment{
>    image_map{ // see section 6.7.1.5.1
>      sys
>      "testsor.bmp"
>      once // see section 6.7.12.7.1
>      map_type 1
>    }
>  }
>}
>
>The main point/drawback is that map_type 1 maps the image using spherical
>mapping - i.e. the above is ideal, mapping the image to a sphere. Because a head
>isn't exactly spherical, you will get some distortion. If your head uses a mesh,
>you would have the option of using UV mapping, but to be honest I've no idea how
>you would go about this without deforming the image too much.
>
Thanks, I'll check the docs on this.
I was trying a sphere. I tried this, but it came out pretty dark...how
do you get it lighter? I tried adding light.
 let me play with it some.


Post a reply to this message

From: Jeff Kish
Subject: Re: "best" way to create an shape covered with a picture?
Date: 19 Nov 2002 22:24:53
Message: <+f=aPWpVSGdEQcvCLyA8Dg7zpiDP@4ax.com>
On 19 Nov 2002 05:26:23 -0500, Warp <war### [at] tagpovrayorg> wrote:

>Jeff Kish <ELN/kishj@earthlink.net> wrote:
>> I am a beginner. I have gone through some tutorials for moray and
>> pov-ray. I have some pictures of my son I would like to map to a 3d
>> shape (shaped like his head of course).. what is the best way to do
>> this? I tried messing around with the pigment/image_map stuff, but
>> that looks like I am going the wrong way there.
>
>  If you are using a mesh to model your object, then uv-mapping gives you
>the best freedom for assigning a pigment to it (you can tell for each vertex
>point which point of the pigment is assigned to it).
>  The problem with this is that it's next to impossible to write it by hand.
>You'll need a modeller which supports uv-mapping in order to do this.
>(I think there's a program called "uv-mapper" which has been praised).
>
>  If your object consists of other primitives, then the issue is a lot
>more complicated. If you want to apply an image map to this object, there's
>basically no other way than using the few default mapping types (eg.
>spherical).
Thanks for your reply.
By mesh, you mean a mesh object where you define all of the points it
consists of? is this a standard way to model organics like heads,
torsos, etc?

I just want to make sure I got in the right direction.

Thanks
Jeff


Post a reply to this message

From: Tom Melly
Subject: Re: "best" way to create an shape covered with a picture?
Date: 20 Nov 2002 04:47:59
Message: <3ddb5a4f$1@news.povray.org>
"Jeff Kish" <ELN/kishj@earthlink.net> wrote in message
news:Bf3aPR=kEAXyhlkPJEGCFN5MWNSq@4ax.com...
> >
> Thanks, I'll check the docs on this.
> I was trying a sphere. I tried this, but it came out pretty dark...how
> do you get it lighter? I tried adding light.
>  let me play with it some.
>

Heh - well make sure you add a camera, a light and of course that you have a bmp
file available.

Here's the full scene I checked my syntax with:

#version 3.5;

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
}

// ----------------------------------------

camera {
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------

plane {
  y, -1
  pigment { color rgb <0.7,0.5,0.3> }
}


#declare MyHead = sphere {0, 1}

object{
  MyHead
  pigment{
    image_map{
      sys
      "testsor.bmp"
      once
      map_type 1
    }
  }
}


Post a reply to this message

From: Tom Melly
Subject: Re: "best" way to create an shape covered with a picture?
Date: 20 Nov 2002 04:52:56
Message: <3ddb5b78$1@news.povray.org>
"Jeff Kish" <ELN/kishj@earthlink.net> wrote in message
news:+f=aPWpVSGdEQcvCLyA8Dg7zpiDP@4ax.com...

> Thanks for your reply.
> By mesh, you mean a mesh object where you define all of the points it
> consists of? is this a standard way to model organics like heads,
> torsos, etc?
>
> I just want to make sure I got in the right direction.
>

A mesh is basically a whole bunch of triangles (known as "facets" iirc). Each
edge of each triangle is shared by another triangle. When you see a figure in a
pov image, you can pretty much bet that it's a mesh, probably consisting of
several thousand triangles.

It's rare to use them for inorganic shapes, since, by and large, such shapes can
be modelled more effectively using primitives and CSG, but trying to model
something like a horse or human using standard pov primitives would be a
nightmare.

Generally, users don't write their own meshes, but will convert them from, for
example, exported poser figures. (poser can't export a mesh directly, but it can
export intermediary formats for which converters exist - iirc there is now a
converter that can handle poser format files directly).


Post a reply to this message

From: Warp
Subject: Re: "best" way to create an shape covered with a picture?
Date: 20 Nov 2002 05:46:39
Message: <3ddb680f@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
> Each edge of each triangle is shared by another triangle.

  Not necessarily. (This is only true for closed meshes.)

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: ABX
Subject: Re: "best" way to create an shape covered with a picture?
Date: 20 Nov 2002 05:49:35
Message: <nupmtucqbjoj7affojseru40aigt7ddh3b@4ax.com>
On 20 Nov 2002 05:46:39 -0500, Warp <war### [at] tagpovrayorg> wrote:
>  Not necessarily. (This is only true for closed meshes.)

Is the mobious tape treated as closed mesh ? ;-)

ABX


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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