POV-Ray : Newsgroups : povray.general : Using png to normal uv mapping : Re: Using png to normal uv mapping Server Time
5 Nov 2024 05:24:22 EST (-0500)
  Re: Using png to normal uv mapping  
From: Manuel
Date: 16 Jun 2003 09:02:03
Message: <3eedbfcb$1@news.povray.org>
>   Only certain objects support uv-mapping, and some of them require
> uv-vectors to work correctly.
>   Without seeing how you are using the texture in question it's difficult
> to tell what's wrong.


Ok, excuse me...now I've extract the problem.
In the code below, if you change the

uv_mapping normal

to

normal

the scene work...use a generic png 200x200 pixel.
The texture.png is RGB, while
the texturebump is grayscale, both made in Gimp.


------------------SAMPLE SCENE UV PROBLEM------------------

#include "finish.inc"
#include "colors.inc"


#declare foo =
texture

     uv_mapping pigment {  image_map {png "texture.png"  map_type 0
interpolate 0}}
     uv_mapping normal { bump_map {png "texturebump.png" bump_size 5.0}}
     }

#declare  Cube  =
mesh

triangle {
    <1.0, -1.0, 0.999999940395>,
    <1.0, -1.0, -1.0>,
    <-1.00000011921, -1.0, -0.999999821186>
     uv_vectors<0.490000009537, 0.0900000035763>,<0.0599999986589,
0.0900000035763>,<0.490000009537, 0.0900000035763>}
triangle {
    <1.0, -1.0, 0.999999940395>,
    <-1.00000011921, -1.0, -0.999999821186>,
    <-0.999999642372, -1.0, 1.00000035763>
     uv_vectors<0.490000009537, 0.0900000035763>,<0.490000009537,
0.0900000035763>,<0.899999976158, 0.0900000035763>}
triangle {
    <-1.00000011921, -1.0, -0.999999821186>,
    <-1.00000035763, 1.0, -0.999999642372>,
    <-0.999999940395, 1.0, 1.0>
     uv_vectors<0.490000009537, 0.0900000035763>,<0.490000009537,
0.930000007153>,<0.899999976158, 0.930000007153>}
triangle {
    <-1.00000011921, -1.0, -0.999999821186>,
    <-0.999999940395, 1.0, 1.0>,
    <-0.999999642372, -1.0, 1.00000035763>
     uv_vectors<0.490000009537, 0.0900000035763>,<0.899999976158,
0.930000007153>,<0.899999976158, 0.0900000035763>}
}


light_source {
    <0, 0, 0>
     color rgb <1.0, 1.0, 1.0>
     fade_distance  10.0
     fade_power  2
     rotate <-90.0000025045, -90.0000025045, 0.0>
     translate <-0.617158889771, -0.680260896683, -0.0853833779693>
}
light_source {
    <0, 0, 0>
     color rgb <1.0, 1.0, 1.0>
     fade_distance  10.0
     fade_power  2
     rotate <-90.0000025045, -90.0000025045, 0.0>
     translate <0.996681690216, 1.01759016514, 0.654029071331>
}
light_source {
    <0, 0, 0>
     color rgb <1.0, 1.0, 1.0>
     fade_distance  10.0
     fade_power  2
     rotate <-90.0000025045, -90.0000025045, 0.0>
     translate <1.34552943707, -1.31237447262, -0.207159176469>
}
camera {
     perspective
     location <7, 1.66473960876, -3.36465549469>
     look_at <-0.082584125588, 0.339812439545, 0.723255069236>

     focal_point <-0.082584125588, 0.339812439545, 0.723255069236>
     right <1.33, 0, 0>
     up <0, 1, 0>
     angle 46.1092074856
}

object   {  Cube
     scale <1.0, 1.0, 1.0>
     rotate <0.0, 44.9999978371, 0.0>
     translate <0.0, 0.0, 0.0>
     texture {foo}
}


Post a reply to this message

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