POV-Ray : Newsgroups : povray.newusers : This may not be a newbie question, just a syntax question. Server Time
31 Jul 2024 08:30:35 EDT (-0400)
  This may not be a newbie question, just a syntax question. (Message 1 to 3 of 3)  
From: normdoering
Subject: This may not be a newbie question, just a syntax question.
Date: 8 Nov 2002 02:20:03
Message: <web.3dcb64d81d8cd29dfeecdaa90@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

From: ABX
Subject: Re: This may not be a newbie question, just a syntax question.
Date: 8 Nov 2002 06:02:09
Message: <r66nsuctqaldv3n95jjai52h1j7h6s6amt@4ax.com>
On Fri,  8 Nov 2002 02:16:40 EST, "normdoering" <nor### [at] yahoocom> wrote:
>         PArr[J][K],   // <-- this code gets highlited in yellow

You are trying to put color as float, try pattern as pigment in your function
definition.

Moreover read rules about crossposting posted in faq droup.

ABX


Post a reply to this message

From: Mark Wagner
Subject: Re: This may not be a newbie question, just a syntax question.
Date: 8 Nov 2002 23:07:49
Message: <pan.2002.11.09.04.06.46.423259.221@gte.net>
On Fri, 08 Nov 2002 05:59:38 -0500, ABX quoth:

> Moreover read rules about crossposting posted in faq droup.

You need to work on your spelling.  Everyone *knows* it's "froup", not
"droup". :-)

-- 
Mark


Post a reply to this message

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