POV-Ray : Newsgroups : povray.general : --- Server Time
4 Nov 2024 23:14:59 EST (-0500)
  --- (Message 1 to 2 of 2)  
From: Alain
Subject: Re: Wrapping paper question
Date: 12 Dec 2009 22:05:38
Message: <4b245a02$1@news.povray.org>

> Hi all,
> 
> I've been a POVRay user for years but haven't touched it much in the last 8 
> months. I'm coming back to it and am a little rusty.
> 
> I've decided to do an XMas scene and want to add some wrapped presents. I 
> have a number of images which tile to make different wrapping paper 
> patterns.
> 
> I'm having an issue getting the wrapping paper to map to the gifts (simple 
> boxes at the moment) - I obviously want the pattern to be visible without 
> distortion on each surface of the box.
> 
> From the manual, I've had a look at the map_types but they don't seem to 
> solve my problem. At the moment, the only solution I can see is to use 6 
> "flat" boxes to make up the different sides and try to make the patterns 
> meet up correctly.
> 
> Curent code is simply:
>    #local GiftTexture = texture {
>     pigment {
>      image_map {jpeg Filename}
>      scale .25
>     }
>     finish {
>      ambient 0 diffuse 1
>     }
>   }
> 
> box{<blah>
>     texture{GiftTexture}
> }
> 
> I've (hopefully) attached a link to a post with some images. in case I've 
> messed up, the post is in p.b.i titled "Images for a question in advanced 
> users re: wrapping paper"
> 
> Can someone please either tell me how I can achieve this or point me at the 
> right method?
> 
> Many thanks in advance
> 
> Simon 
> 
> 

The image_map is effectively an infinite volume having your image in a 
given direction.
Any object is "carved" from that, it don't wrap around.

Some things you can do:
Use a mesh and UV map your image.

Construct your box from smaller, thin, boxes. Create them all with a 
common surface and connected, as if from a single surface. You then 
rotate the various parts as needed to create your final box. Start by 
the most outside ones, bind in an union and rotate the next one. By 
using triangular and trapezoidal elements, you can recreate the way 
actual wraping paper overlap on real boxes.



Alain


Post a reply to this message

From: Simon Orr
Subject: Re: Wrapping paper question
Date: 13 Dec 2009 01:38:44
Message: <4b248bf4@news.povray.org>
> Construct your box from smaller, thin, boxes. Create them all with a 
> common surface and connected, as if from a single surface. You then rotate 
> the various parts as needed to create your final box. Start by the most 
> outside ones, bind in an union and rotate the next one. By using 
> triangular and trapezoidal elements, you can recreate the way actual 
> wraping paper overlap on real boxes.


That's a fantastic suggestion - I'll give it a go, many thanks

Simon


Post a reply to this message

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