POV-Ray : Newsgroups : povray.general : Calling external Math functions from .dll or .so : Re: Calling external Math functions from .dll or .so Server Time
2 Aug 2024 10:20:56 EDT (-0400)
  Re: Calling external Math functions from .dll or .so  
From: Rafal 'Raf256' Maj
Date: 12 Feb 2005 01:51:48
Message: <Xns95FB4FE54215Draf256com@203.29.75.35>
nomail@nomail news:web.420b7c34c551b3d17485eb850@news.povray.org

> I'd like to call Library-Functions from SDL. Is there already an
> extension to POV-Ray that enables declaration of external user-defined
> functions? 
> 

I think it would be a greate idea. Hmm how about soemthing like this - 
extent funcitons so that could work as a plugins for doing most things, not 
only pattern functions (in density, pigment, and so on), but also while 
shooting rays for camera and in other places.

Now extent macro language. Would it be very hard to implement minimalistic 
C-like language interpreter? Then, on some platforms such funcitons could 
be compiled using gcc before rendering to speed it up (someone done this 
patch already, AFAIK it was mostnly for isosurfaces on Linux?). On other 
platforms - it would be interpreted.

It would work like:


#function Vector3 ShootRay(float x, float y) { 
  Vector3 r;
  r.x = x/2 + sin(y);   
  //...
  return r;
}

#funcion Color Pigment1(float x, float y, float z) {
  return ...... ;
}

camera { use { ShootRay } }

sphere { 0 1 pigment { use { Pigment1 } }


 
-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

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