POV-Ray : Newsgroups : povray.newusers : Having trouble with textures : Having trouble with textures Server Time
1 Jul 2024 02:59:51 EDT (-0400)
  Having trouble with textures  
From: John Ratcliff
Date: 7 Jun 2011 18:30:01
Message: <web.4deea56a8c68d15190ae49fd0@news.povray.org>
I'm having trouble getting textures to show up in my sample POV script.

Attached is a 'hello world' style example.  It's just a single quad (two
triangles) which is supposed to project a texture.

To run it, you will need file called 'test.jpg' in the same directory as the
script.

Any help debugging this would be much appreciated because I can't tell what's
wrong with this.

------------------------------------



#version 3.5;

light_source {
 <1.5, 1, 0.5>*10000
  color rgb <1.0, 1.0, 1.0>
}

   camera {
    location    <150.000000000 50.000000000 150.000000000>
     direction   x
     sky         y
     up          y
     right       (4/3)*x
     look_at     <150.000000000,0.000000000,150.000000000>
     angle       45
   }

// ------- Mesh test.obj SubMesh test.jpg

#declare test_00_00=
   mesh2{
    vertex_vectors{
     4
      <300.000000000, 0.000000000, 300.000000000>,
      <300.000000000, 0.000000000, 0.000000000>,
      <0.000000000, 0.000000000, 0.000000000>,
      <0.000000000, 0.000000000, 300.000000000>,
    }
    normal_vectors{
     1
      <0.000000000, 1.000000000, 0.000000000>,
    }
    uv_vectors{
     4
      <1.000000000, 1.000000000>,
      <1.000000000, 0.000000000>,
      <0.000000000, 0.000000000>,
      <0.000000000, 1.000000000>,
    }
    face_indices{
     2,
      <0,1,2>,
      <3,0,2>,
    }
    normal_indices{
     2,
      <0,0,0>,
      <0,0,0>,
    }
    uv_indices{
     2,
      <0,1,2>,
      <3,0,2>,
    }

   }


   object {
    test_00_00
texture {
 material_map {
  jpeg "test.jpg"
   texture {  //used with index 0
    finish  {specular 1}
    scale 1
  }
 }
}
   }


Post a reply to this message

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