POV-Ray : Newsgroups : moray.win : SimCloth.lua plugin (Cloth simulation of MegaPov) : Re: SimCloth.lua plugin (Cloth simulation of MegaPov) Server Time
17 Jun 2024 04:54:38 EDT (-0400)
  Re: SimCloth.lua plugin (Cloth simulation of MegaPov)  
From: Andre de Leiradella
Date: 22 Oct 2004 08:55:00
Message: <web.417902cbf62557f857904ff10@news.povray.org>
"StephenS" <sshonfield(at)ottawa(dot)net> wrote:
> > Great ! But not easy and slow....
> > Is it possible to get a rounded nappe ?
> > Friendly
> > Sylvain
> The simcloth{} object will only accept a rectangular grid (N1xN2).
> You can fake a round nappe by having the texture with transparent parts.
>
> See picture in moray.binaries
>    simcloth_round_nappe
>
> The current plugin will not let you have more than one plugin.
>    'can not re-declare a function'
> Will be fixed in next update.
>
> Stephen


Hi Stephen,

Could you provide more info about the error message? Maybe I can help you
correct the bug.

I took a look at SimCloth.lua and I have a couple of sugestions:

1) In methods listcloth, listsim and listUDO it'll be better to declare f as
a local variable instead of as a parameter (e.g. function
SimCloth:listsim() local f="" ... return f end). Don't forget to remove the
parameter when you call those methods (e.g. self:listsim() instead of
self:listsim(f))

2) You use dostring at some places to declare global variables (e.g.
dostring("Distance="..self.core:povtolua(self.Clothvalue[1]))). Plugins
should not use global variables since you never now if another plugin will
use a global variable with the same name. It'll be better to rewrite those
as

local Distance=dostring(self.core:povtolua(self.Clothvalue[1]))

You don't have to change code where those variables are used though.

Regards,

Andre de Leiradella


Post a reply to this message

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