POV-Ray : Newsgroups : povray.programming : complicated functions : Re: complicated functions Server Time
28 Jul 2024 20:23:12 EDT (-0400)
  Re: complicated functions  
From: Chris Huff
Date: 11 Nov 2000 12:40:04
Message: <chrishuff-4A45B6.12401211112000@news.povray.org>
In article <3a0d736f@news.povray.org>, "Wlodzimierz ABX Skiba" 
<abx### [at] abxartpl> wrote:

> >In other words, allowing the function to be called in ordinary scene
> >code...
> 
> yes
> 
> >this should be pretty easy
> 
> I hope

I am thinking something like this, in the Parse_Num_Factor() function in 
express.c:

#include "isosrf.h"

...

    CASE(FUNC_ID_TOKEN)
    {
        DBL result = 0;
        int i=0;
        VECTOR Point;
        FUNCTION * TFunc = NULL;

        Load_Function(TFunc, ((FUNCTION *)Token.Data)->func_name);/*?*/
        
        GET(LEFT_PAREN_TOKEN)
        Parse_Vector(Point);
        GET(RIGHT_PAREN_TOKEN)
        if(TFunc != NULL)
            result = (TFunc->iso_func)(TFunc, Point);
        
        for(i=0; i < *Terms; i++)
            Express[i] = Val;
    }
    END_CASE

I don't know if this will work(it compiles, but it hasn't been tested), 
and I have no idea what Load_Function() does...but it's a start.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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