POV-Ray : Newsgroups : povray.advanced-users : Trying to write new HF_ macros, how to cut the mesh? : Trying to write new HF_ macros, how to cut the mesh? Server Time
29 Jul 2024 06:13:47 EDT (-0400)
  Trying to write new HF_ macros, how to cut the mesh?  
From: normdoering
Date: 9 Nov 2002 13:15:06
Message: <web.3dcd4ff566ca52347efeba520@news.povray.org>
I'm trying to write my first new HF_ macro (as in shapes.inc) and the first
thing I want to do is rewrite the HF_Square (as HF_pressmold()) so that you
don't get excess mesh where you don't want it. That is, not a square, but a
cut out shape. What seems to be offered are these dot operators.

There are five possible components and the supported dot types to access
these components -- from the isosurface section of POV help:

F( ).x | F( ).u | F( ).red
to get the red value of the color vector
F( ).y | F( ).v | F( ).green
to get the green value of the color vector
F( ).z | F( ).blue
to get the blue value of the color vector
F( ).filter | F( ).t
to get the filter value of the color vector
F( ).transmit
to get the transmit value of the color vector
F( ).gray
to get the gray value of the color vector
gray value = Red*29.7% + Green*58.9% + Blue*11.4%
F( ).hf
to get the height_field value of the color vector
hf value = (Red + Green/255)*0.996093

If another function is declared and used by a new HF_ macro in order to get
another color channel that channel might tell the macro where to cut off
excess mesh to get the shape desired. I don't know if transmit and filter
channels can be easily made by all paint programs or if theres a way the
masks corel draw can make for .png files can be accessed (is transmit a
mask channel?).

All the colors make white, that shows up on all color channels, I think. So,
you'd have to do some sort of compare...

#if (red_component < blue_component + green_component)
--make a mesh point on the grid--
#else
--skip this part of the grid--
#end

I think the above code would cut out all elements of a picture with a strong
red tinge.

However, how does one express that cutting so that HFCreate_() can read it?
Will HFCreate have to be rewritten too?

And if so... what's a good way to do it? make another array grid just to
tell the create macro where to cut? There should be a better way...

Just thinking out loud here, maybe someone out there has ideas.

normdoering


Post a reply to this message

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