POV-Ray : Newsgroups : povray.newusers : Can't get this mapped properly. : Can't get this mapped properly. Server Time
4 Sep 2024 22:18:04 EDT (-0400)
  Can't get this mapped properly.  
From: Jon B
Date: 21 Jul 2002 22:19:56
Message: <3D3B6BA4.2020207@indecisions.org>
Howdy all! :-D

Right now I'm building a mame cabinet in POV-Ray and all is going well 
so far.

I have the actual cabinet all pieced together in POV-Ray, but now I'm 
going into the detail of things by adding joystick/buttons/etc.

What I'm having a problem with is getting an image mapped onto one of 
the buttons properly. I just can't figure it out, so I'm kindly asking 
if you could help me complete this small annoyance so that I may 
continue to finish this project.  On a side note, my friend and I are 
actually building a mame cabinet, I'm just doing this in POV-Ray for fun :-)

So anyways...

I am trying to map

http://www.hostriot.com/072002/help-1.gif

onto the button as seen in this picture

http://www.hostriot.com/072002/help-2.gif

Here is the code snipplet.

#declare button =
         union{
		//base cylinder
                 cylinder{<0,0,0> <0,.5,0>,1.1 }

		//rounded lower part of the button
                 difference{
                         sphere{<0,0,0>,1.2 }
                         box{<-5,.2,-5> <5,5,5>}
                         box{<-5,-5,-5> <5,0,5>}
                         translate .5*y
                 }

		//The part of the button where finger is pushed on
                 difference{
                         cylinder{<0,.5,0> <0,1,0>,.9}
                         sphere{<0,2,0>,1.2 scale<1.1,1,1.1> }
                 }

		//cutting a torus in half to make the round lip
                 difference{
                         torus{.8,.1 }
                         box{<-5,0,-5> <5,-5,5>}
                         translate 1*y
                 }
             }

So where I have the cylinder being cut by the sphere (part where finger 
is pushed on) I tried to map it there, but I couldn't figure out how to 
make it show up correctly.  Reading through the manual, very nicely done 
for 3.5 by the way, I still couldn't get things working properly.

What I am trying to accomplish is getting that small player guy mapped 
onto the button as to give it the appearance that it's been painted or 
stickered on.  While I do that, I'd prefer to keep the slightly dug out 
rounded shape of the button.

This is a bit of a snag for me, and I'd appreciate the help you guys can 
lend to me :-)

I can't wait for this project (both povray and real life) to be 
completed.  More so, I'd like to show it off when it's ready :-)

Thanks in advance :-)

-Jon


Post a reply to this message

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