POV-Ray : Newsgroups : povray.text.tutorials : Can anyone show me the proper syntax for this... : Can anyone show me the proper syntax for this... Server Time
25 Apr 2024 09:58:39 EDT (-0400)
  Can anyone show me the proper syntax for this...  
From: normdoering
Date: 8 Nov 2002 03:10:03
Message: <web.3dcb712a3dbbae33e944edd0@news.povray.org>
I'm trying to use the HF_ functions in shapes.inc to generate a mesh from a
small .png file.

I simply added a new funtion to the example file given in the include files
demo. When I did, I got an error.



//==============================

#declare MyFunction = function{pattern {bumps scale 0.2}}
 // MyFunction above works...

#declare MyTest = function
 { pigment
   { image_map
     {png "testHF.png"
      map_type 0 interpolate 2
     }
    }
  } // <- this replacement produces an error.
    // shapes.inc pops up and marks the bit of code named above


object {
   HF_Square
    ( MyTest, // MyFunction was here, but I replaced it.
      off,
      off,
      <60,60>,
      on,
      "",
      <0.0, 0.1, 0.0>,
      <1.5, 0.5, 1.5>
    )
   texture {
      pigment {color rgb 1}
      finish {ShinyFinish}
   }
   translate <-3.0, 0.0,-3.2>
}

// ===========
// The error that happens pops up shapes.inc and a line in the
// HFCreate_() macro gets marked. See note below.
// ====
  #local J = 1;
   #while (J<=xRes)
      #local K = 1;
      #while (K<=zRes)
         PArr[J][K],   // <-- this code gets highlited in yellow
         #declare K = K+1;
      #end
      #declare J = J+1;
   #end

//====================================

What do I do to get an image file used as a function?

normdoering


Post a reply to this message

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