POV-Ray : Newsgroups : povray.unofficial.patches : Clothsim constraints question, Megapov 1.21 Server Time
25 May 2024 06:29:46 EDT (-0400)
  Clothsim constraints question, Megapov 1.21 (Message 1 to 5 of 5)  
From: Grassblade
Subject: Clothsim constraints question, Megapov 1.21
Date: 14 Mar 2007 16:35:01
Message: <web.45f869e327503f4b62353b880@news.povray.org>
I'm looking at the append.pov code and I don't understand how the
constraints work. 4.1.1 in the manual doesn't mention constraints at all,
and the 2.4.3.1 bit seems to be talking to people who already know how it
all works.

I gather the relevant code is:
  #write(file, 39*Precision, ", 0.0, 0.0, 0.0,n")
  #write(file, 38*Precision, ", 0.5, 0.5, 0.5,n")
  #write(file, (40+38)*Precision, ", 0.5, 0.5, 0.5,n")
  #write(file, (40+39)*Precision, ", 0.5, 0.5, 0.5,n")

Precision is 2, so what does 39*2 mean? It doesn't seem to be coordinates,
as far as I can tell, but then how do I tell MegaPOV I want the cloth's
center point to remain fixed? I do get the 0.0,0.0,0.0 bit, it's the
localisation of points that baffles me.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Clothsim constraints question, Megapov 1.21
Date: 17 Mar 2007 07:52:30
Message: <45fbe48e$1@news.povray.org>
I cannot answer your question because I have (had) also hard times to 
understand the workings of Clothsim in places.
IIRC, in the past, when Christophe first presented this utility, before it 
was incorporated in Megapov, the tutorials where more extant, treating also 
the use for curtains and flags in detail. But that has been lost and 
unfortunately, I am unable to find any trace of it in my backup files :-(
Perhaps this thread will generate a response. I would also be very 
interested.

Thomas


Post a reply to this message

From: Smellenbergh
Subject: Re: Clothsim constraints question, Megapov 1.21
Date: 18 Mar 2007 09:07:22
Message: <1hv6d4j.do84e8fn4z5pN%smellenbergh@skynet.be>
The original tutorial of Christophe Bouffartige's clothray can be found
at: http://tofbouf.free.fr/clothray/index_en.html
It doesn't contain more info on the constraints, but there is a page
with some example scenes at:
http://tofbouf.free.fr/clothray/mpg/mpg.html
You could check these to figure out how those extra's work.

Keep in mind that the .cth file is a list of grid points written row
after row. If you need to constraint points, you have to figure out
their sequence number in that list, and append them at the end.
In the .cth file add a line with:
  list_number, constraint.x, constraint.y, constraint.z
for each point that needs to be constarined.

Example; a 5*5 grid around the center where we want to hold that center
point at <0,0,0>
Add
  #fopen file "filename.cth" append
    #write(file, 12, ", 0.0, 0.0, 0.0,\n")
  #fclose file
in the scene file. This will be written as
  12, 0.0, 0.0, 0.0,
at the end of the .cth file. The center point is point number thirteen,
but we start counting from zero!!
The figures after the point number are restricting coefficients for each
direction. Zero means no movement. One means no restraint, and values in
between allow only for a fraction of the step.

I hope this gets you started,

-- 

e-mail:sme### [at] skynetbe

http://users.skynet.be/smellenbergh


Post a reply to this message

From: Grassblade
Subject: Re: Clothsim constraints question, Megapov 1.21
Date: 18 Mar 2007 16:15:01
Message: <web.45fdab0d484ee60b8399fb9f0@news.povray.org>
sme### [at] skynetbe (Smellenbergh) wrote:
> The original tutorial of Christophe Bouffartige's clothray can be found
> at: http://tofbouf.free.fr/clothray/index_en.html
> It doesn't contain more info on the constraints, but there is a page
> with some example scenes at:
> http://tofbouf.free.fr/clothray/mpg/mpg.html
> You could check these to figure out how those extra's work.
>
> Keep in mind that the .cth file is a list of grid points written row
> after row. If you need to constraint points, you have to figure out
> their sequence number in that list, and append them at the end.
> In the .cth file add a line with:
>   list_number, constraint.x, constraint.y, constraint.z
> for each point that needs to be constarined.
>
> Example; a 5*5 grid around the center where we want to hold that center
> point at <0,0,0>
> Add
>   #fopen file "filename.cth" append
>     #write(file, 12, ", 0.0, 0.0, 0.0,n")
>   #fclose file
> in the scene file. This will be written as
>   12, 0.0, 0.0, 0.0,
> at the end of the .cth file. The center point is point number thirteen,
> but we start counting from zero!!
> The figures after the point number are restricting coefficients for each
> direction. Zero means no movement. One means no restraint, and values in
> between allow only for a fraction of the step.
>
> I hope this gets you started,

> --
>
> e-mail:sme### [at] skynetbe
>
> http://users.skynet.be/smellenbergh

Thank you very much, this gets me started indeed! I thought constraints were
applied only to sides, now I see the error of my ways.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Clothsim constraints question, Megapov 1.21
Date: 19 Mar 2007 03:06:10
Message: <45fe4472$1@news.povray.org>
Thank you very much indeed!!! I have been puzzling over this a long while. 
This is very clear!

Thomas


Post a reply to this message

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