POV-Ray : Newsgroups : povray.newusers : Make it shorter. Server Time
26 Nov 2024 10:39:10 EST (-0500)
  Make it shorter. (Message 1 to 8 of 8)  
From: Oleguer Vilella
Subject: Make it shorter.
Date: 11 Aug 2004 11:41:24
Message: <411a3e24$1@news.povray.org>
Hello,

I have to make shorter this membrane I don't know how can I do it. I also
make an angle like a bridge I trayed with sine and cosine but, logically,
it's doesn't work like I need. The code is:

#include "colors.inc"
#include "textures.inc"
  background { White
  }
  camera {location <170, -11, -110>look_at  <180, -15, -16>}
  light_source { <170, -30, -100> color White}

#declare lipid =  union {
                        blob{  threshold 0.1
                                sphere {<0, 0, 0>, 2 ,1 texture {pigment {
color Red }finish { ambient 0.2 diffuse 0.8 phong 1 }} scale 0.8}
                                cylinder {<0.8,0,0>,<0.8,-5,0>, 0.5,1
texture {pigment { color White }finish { ambient 0.2 diffuse 0.8 phong 1 }}
scale 0.8 }
                                cylinder {<-0.8,0,0>,<-0.8,-5,0>, 0.5,1
texture {pigment { color White }finish { ambient 0.2 diffuse 0.8 phong 1 }}
scale 0.8 }
                        ////rotate <0, 0, 0> translate <0, 14, 1>
                        }

                        blob{  threshold 0.1
                                sphere {<0, 0, 0>, 2 ,1 texture {pigment {
color Red }finish { ambient 0.2 diffuse 0.8 phong 1 }} scale 0.8 }
                                cylinder {<0.8,0,0>,<0.8,-5,0>, 0.5,1
texture {pigment { color White }finish { ambient 0.2 diffuse 0.8 phong 1 }}
scale 0.8 }
                                cylinder {<-0.8,0,0>,<-0.8,-5,0>, 0.5,1
texture {pigment { color White }finish { ambient 0.2 diffuse 0.8 phong 1 }}
scale 0.8 }
                        rotate <190,0,0>translate <0,-8,-1> }
                        translate <90, 0, 0> scale 0 scale <0, -0.78, 0>
                  }

// Fi d'unitats basiques lipid mes paret
// Macro per a crear la membrana
// Apunt: per a crear sensacio de desordre es poden rotar els stuffs en
l'eix y. Aixo produeix l'efecte que les cadenes hidrofobiques del lipid no
estan sempre paralleles. Al final he optat per no tocar el rotate, per a
incrementar l'ordre de la membrana.
#macro Make_Stuff (Stuff,How_Many)
#local Ample=-12;

// Bicapa en una sola dimensio, eix z

#while (Ample<How_Many)
    object{Stuff  rotate <0,0*Ample,0> translate<3*Ample,0*cos
(Ample/8),0> }
    #local Ample=Ample+1;
  #end
#end
// Si es vol una bicapa mes llarga es pot incrementar el nombre de molecules
de lipid. Per defecte, esta a 100. Com mes lipids es posin mes costara crear
la imatge!
#declare layer = union {Make_Stuff (lipid,100)}
///////global_settings { max_trace_level 29 }
// Fi de Bicapa en una sola dimensio
//Bicapa en les dos dimensions del pla de la membrana.
#macro Make_Many (Stuff,How_Many)
#local Fons=0;

#while (Fons<How_Many)
    object{Stuff  translate <0,0*sin (Fons/8),3*Fons>}
    #local Fons=Fons+1;
  #end
#end
// Incrementar el nombre de bicapes unidimensionals per a fer una membrana
mes fonda. 50 molecules de lipid de fons funciona be, 72 amb el

union {Make_Many (layer,50)}
//   End of the code.

Please if someone can help me, replay in the group.
I wait your ideas.

Thank you in advance,
Oleguer
http://www.infonegocio.com/oleguervm


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Make it shorter.
Date: 11 Aug 2004 15:22:58
Message: <411a7212@news.povray.org>
Oleguer Vilella wrote:

> Hello,
> 
> I have to make shorter this membrane I don't know how can I do it. I also
> make an angle like a bridge I trayed with sine and cosine but, logically,
> it's doesn't work like I need. The code is:
...
> Please if someone can help me, replay in the group.
> I wait your ideas.

Oleguer, I don't understand what you are trying to achieve.

Maybe that is because I am not able to understand your
spanish(?) comments and because I know little about lipids
and membranes.

(Babelfish at http://www.infonegocio.com/oleguervm could
not help me much either ):

Please try to explain more. Do you have links to any images
that shows similar shapes to those that you are trying to
make ?


In order to make it easier for others in these news groups
to help, you should try to make your code more structured
and readable. I have done this with your code -> See below.


Remember that the sin() and cos() functions in POV-Ray
expects their arguments to be in radians, not degrees.


Tor Olav


// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.6;

#include "colors.inc"
#include "textures.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#macro Make_Stuff(Stuff, How_Many)

   #local Ample = -12;
   #while (Ample < How_Many)
     object {
       Stuff
       rotate <0, 0*Ample, 0>
       translate <3*Ample, 0*cos(Ample/8), 0>
     }
     #local Ample = Ample + 1;
   #end // while

#end // macro Make_Stuff


#macro Make_Many(Stuff, How_Many)

   #local Fons = 0;
   #while (Fons < How_Many)
     object {
       Stuff
       translate <0, 0*sin(Fons/8), 3*Fons>
     }
     #local Fons = Fons + 1;
   #end // while

#end // macro Make_Many

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare Finish =
   finish {
     ambient 0.2
     diffuse 0.8
     phong 1
   }

#declare RedTexture =
   texture {
     pigment { color Red }
     finish { Finish }
   }

#declare WhiteTexture =
   texture {
     pigment { color White }
     finish { Finish }
   }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare Blob =
   blob {
     threshold 0.1
     sphere {
       <0, 0, 0>, 2, 1
       texture { RedTexture }
       scale 0.8
     }
     cylinder {
       <0.8, 0, 0>, <0.8, -5, 0>, 0.5, 1
       texture { WhiteTexture }
       scale 0.8
     }
     cylinder {
       <-0.8, 0, 0>, <-0.8, -5, 0>, 0.5, 1
       texture { WhiteTexture }
       scale 0.8
     }
   }


#declare Lipid =
   union {
     object {
       Blob
//      rotate <0, 0, 0>
//      translate <0, 14, 1>
     }
     object {
       Blob
       rotate <190, 0, 0>
       translate <0, -8, -1>
     }
     translate <90, 0, 0>
     scale 0 // Does not make sense. Read the warnings POV-Ray outputs.
     scale <0, -0.78, 0>
   }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare Layer = union { Make_Stuff(Lipid, 100) }

union { Make_Many(Layer, 50) }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

background { color White }

camera {
   location <170, -11, -110>
   look_at <180, -15, -16>
}

light_source {
   <170, -30, -100>
   color White
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Make it shorter.
Date: 11 Aug 2004 15:45:58
Message: <411a7776@news.povray.org>
Hello,

Well, if you render my picture you will see a very large membrane. I want
make it shorter, for example: if it's 14cm I will make it 10cm. You don't
have to look my web site, only you should run the code that I have sent in
the group. Do you understand me??

Best regards,
Oleguer


mensaje news:411a7212@news.povray.org...
> Oleguer Vilella wrote:
>
> > Hello,
> >
> > I have to make shorter this membrane I don't know how can I do it. I
also
> > make an angle like a bridge I trayed with sine and cosine but,
logically,
> > it's doesn't work like I need. The code is:
> ...
> > Please if someone can help me, replay in the group.
> > I wait your ideas.
>
> Oleguer, I don't understand what you are trying to achieve.
>
> Maybe that is because I am not able to understand your
> spanish(?) comments and because I know little about lipids
> and membranes.
>
> (Babelfish at http://www.infonegocio.com/oleguervm could
> not help me much either ):
>
> Please try to explain more. Do you have links to any images
> that shows similar shapes to those that you are trying to
> make ?
>
>
> In order to make it easier for others in these news groups
> to help, you should try to make your code more structured
> and readable. I have done this with your code -> See below.
>
>
> Remember that the sin() and cos() functions in POV-Ray
> expects their arguments to be in radians, not degrees.
>
>
> Tor Olav
>
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #version 3.6;
>
> #include "colors.inc"
> #include "textures.inc"
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #macro Make_Stuff(Stuff, How_Many)
>
>    #local Ample = -12;
>    #while (Ample < How_Many)
>      object {
>        Stuff
>        rotate <0, 0*Ample, 0>
>        translate <3*Ample, 0*cos(Ample/8), 0>
>      }
>      #local Ample = Ample + 1;
>    #end // while
>
> #end // macro Make_Stuff
>
>
> #macro Make_Many(Stuff, How_Many)
>
>    #local Fons = 0;
>    #while (Fons < How_Many)
>      object {
>        Stuff
>        translate <0, 0*sin(Fons/8), 3*Fons>
>      }
>      #local Fons = Fons + 1;
>    #end // while
>
> #end // macro Make_Many
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #declare Finish =
>    finish {
>      ambient 0.2
>      diffuse 0.8
>      phong 1
>    }
>
> #declare RedTexture =
>    texture {
>      pigment { color Red }
>      finish { Finish }
>    }
>
> #declare WhiteTexture =
>    texture {
>      pigment { color White }
>      finish { Finish }
>    }
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #declare Blob =
>    blob {
>      threshold 0.1
>      sphere {
>        <0, 0, 0>, 2, 1
>        texture { RedTexture }
>        scale 0.8
>      }
>      cylinder {
>        <0.8, 0, 0>, <0.8, -5, 0>, 0.5, 1
>        texture { WhiteTexture }
>        scale 0.8
>      }
>      cylinder {
>        <-0.8, 0, 0>, <-0.8, -5, 0>, 0.5, 1
>        texture { WhiteTexture }
>        scale 0.8
>      }
>    }
>
>
> #declare Lipid =
>    union {
>      object {
>        Blob
> //      rotate <0, 0, 0>
> //      translate <0, 14, 1>
>      }
>      object {
>        Blob
>        rotate <190, 0, 0>
>        translate <0, -8, -1>
>      }
>      translate <90, 0, 0>
>      scale 0 // Does not make sense. Read the warnings POV-Ray outputs.
>      scale <0, -0.78, 0>
>    }
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #declare Layer = union { Make_Stuff(Lipid, 100) }
>
> union { Make_Many(Layer, 50) }
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> background { color White }
>
> camera {
>    location <170, -11, -110>
>    look_at <180, -15, -16>
> }
>
> light_source {
>    <170, -30, -100>
>    color White
> }
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Make it shorter.
Date: 11 Aug 2004 18:49:30
Message: <411aa27a$1@news.povray.org>
Oleguer Vilella wrote:
> Hello,
> 
> Well, if you render my picture you will see a very large membrane. I want
> make it shorter, for example: if it's 14cm I will make it 10cm. You don't
> have to look my web site, only you should run the code that I have sent in
> the group. Do you understand me??

I'm not sure if I understand you, but below is my best try at
guessing what you want.

Note that I wasn't referring to any images on your website.
I was just thinking that maybe you had seen something similar
somewhere else on the internet that could give me a clue on what
you want.


Tor Olav

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.6;

#include "colors.inc"
#include "textures.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#macro MakeMany(Stuff, xSpc, zSpc, xNr, zNr, xFreq, zFreq, Ampl)

   #local xStart = -xNr/2*xSpc;
   #local zStart = -zNr/2*zSpc;

   #local xCnt = 0;
   #while (xCnt < xNr)
     #local zCnt = 0;
     #while (zCnt < zNr)
       #local xPos = xStart + xCnt*xSpc;
       #local yPos =
         Ampl*sin(xFreq*xCnt/xNr*2*pi)*cos(zFreq*zCnt/zNr*2*pi);
       #local zPos = zStart + zCnt*zSpc;
       object {
         Stuff
         translate <xPos, yPos, zPos>
       }
       #local zCnt = zCnt + 1;
     #end // while
     #local xCnt = xCnt + 1;
   #end // while

#end // macro MakeMany

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare Finish =
   finish {
     ambient 0.2
     diffuse 0.8
     phong 1
   }

#declare RedTexture =
   texture {
     pigment { color Red }
     finish { Finish }
   }

#declare WhiteTexture =
   texture {
     pigment { color White }
     finish { Finish }
   }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare Lipid =
   blob {
     threshold 0.1
     sphere {
       <0, 5, 0>, 2, 1
       texture { RedTexture }
     }
     sphere {
       <0, -5, 0>, 2, 1
       texture { RedTexture }
     }
     cylinder {
       <0.8, 5, 0>, <0.8, -5, 0>, 0.5, 1
       texture { WhiteTexture }
     }
     cylinder {
       <-0.8, 5, 0>, <-0.8, -5, 0>, 0.5, 1
       texture { WhiteTexture }
     }
   }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare X_Spacing = 3;
#declare Z_Spacing = 4;
#declare X_Copies = 20;
#declare Z_Copies = 30;
#declare X_Frequency = 1;
#declare Z_Frequency = 2;
#declare Amplitude = 5;

union {
   MakeMany(
     Lipid,
     X_Spacing, Z_Spacing,
     X_Copies, Z_Copies,
     X_Frequency, Z_Frequency,
     Amplitude,
   )
//  rotate 30*y
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

background { color Blue/2 }

camera {
//  orthographic
   location <0, 1, -4>*30
   look_at <0, -6, 0>
}

light_source {
   <2, 1, -1>*100
   color White
   shadowless
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Make it shorter.
Date: 11 Aug 2004 18:51:18
Message: <411aa2e6$1@news.povray.org>
By the way: Can anyone else tell me why I get this warning ?

   File: E:\Raytracinger\Lipid.pov  Line: 97
   Warning: No pigment type given.

Line 97 is at the end of the union {}
All the blob components has pigments, as far as I can see.

Should I go and Read The Fine Manual ?

-- 
Tor Olav
http://subcube.net
http://subcube.com


Post a reply to this message

From: Hughes, B 
Subject: Re: Make it shorter.
Date: 11 Aug 2004 19:18:29
Message: <411aa945$1@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDhotmailcom> wrote in message
news:411aa2e6$1@news.povray.org...
>
> By the way: Can anyone else tell me why I get this warning ?
>
>    File: E:\Raytracinger\Lipid.pov  Line: 97
>    Warning: No pigment type given.
>
> Line 97 is at the end of the union {}
> All the blob components has pigments, as far as I can see.
>
> Should I go and Read The Fine Manual ?

I'm not sure if it says anything about what I believe it is. The blob object
lacks a pigment for itself, meaning that those given for the component parts
aren't the entire blob's texture or pigment.

Might seem redundant to add an unused pigment but I don't think it was ever
changed to find if every part had a pigment already and skip the warning.

Bob H.


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Make it shorter.
Date: 11 Aug 2004 19:48:03
Message: <411ab033$1@news.povray.org>
Hughes, B. wrote:

> "Tor Olav Kristensen" <tor### [at] TOBEREMOVEDhotmailcom> wrote in message
> news:411aa2e6$1@news.povray.org...
> 
>>By the way: Can anyone else tell me why I get this warning ?
>>
>>   File: E:\Raytracinger\Lipid.pov  Line: 97
>>   Warning: No pigment type given.
>>
>>Line 97 is at the end of the union {}
>>All the blob components has pigments, as far as I can see.
>>
>>Should I go and Read The Fine Manual ?
> 
> 
> I'm not sure if it says anything about what I believe it is. The blob object
> lacks a pigment for itself, meaning that those given for the component parts
> aren't the entire blob's texture or pigment.
> 
> Might seem redundant to add an unused pigment but I don't think it was ever
> changed to find if every part had a pigment already and skip the warning.

Ok, I see.

Thank you for your feedback on this Bob.

-- 
Tor Olav
http://subcube.net
http://subcube.com


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Make it shorter.
Date: 12 Aug 2004 03:03:39
Message: <411b164b@news.povray.org>
How have you done it? And to make it smaller?
Thank you in advance,
Oleguer


mensaje news:411aa27a$1@news.povray.org...
> Oleguer Vilella wrote:
> > Hello,
> >
> > Well, if you render my picture you will see a very large membrane. I
want
> > make it shorter, for example: if it's 14cm I will make it 10cm. You
don't
> > have to look my web site, only you should run the code that I have sent
in
> > the group. Do you understand me??
>
> I'm not sure if I understand you, but below is my best try at
> guessing what you want.
>
> Note that I wasn't referring to any images on your website.
> I was just thinking that maybe you had seen something similar
> somewhere else on the internet that could give me a clue on what
> you want.
>
>
> Tor Olav
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #version 3.6;
>
> #include "colors.inc"
> #include "textures.inc"
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #macro MakeMany(Stuff, xSpc, zSpc, xNr, zNr, xFreq, zFreq, Ampl)
>
>    #local xStart = -xNr/2*xSpc;
>    #local zStart = -zNr/2*zSpc;
>
>    #local xCnt = 0;
>    #while (xCnt < xNr)
>      #local zCnt = 0;
>      #while (zCnt < zNr)
>        #local xPos = xStart + xCnt*xSpc;
>        #local yPos =
>          Ampl*sin(xFreq*xCnt/xNr*2*pi)*cos(zFreq*zCnt/zNr*2*pi);
>        #local zPos = zStart + zCnt*zSpc;
>        object {
>          Stuff
>          translate <xPos, yPos, zPos>
>        }
>        #local zCnt = zCnt + 1;
>      #end // while
>      #local xCnt = xCnt + 1;
>    #end // while
>
> #end // macro MakeMany
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #declare Finish =
>    finish {
>      ambient 0.2
>      diffuse 0.8
>      phong 1
>    }
>
> #declare RedTexture =
>    texture {
>      pigment { color Red }
>      finish { Finish }
>    }
>
> #declare WhiteTexture =
>    texture {
>      pigment { color White }
>      finish { Finish }
>    }
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #declare Lipid =
>    blob {
>      threshold 0.1
>      sphere {
>        <0, 5, 0>, 2, 1
>        texture { RedTexture }
>      }
>      sphere {
>        <0, -5, 0>, 2, 1
>        texture { RedTexture }
>      }
>      cylinder {
>        <0.8, 5, 0>, <0.8, -5, 0>, 0.5, 1
>        texture { WhiteTexture }
>      }
>      cylinder {
>        <-0.8, 5, 0>, <-0.8, -5, 0>, 0.5, 1
>        texture { WhiteTexture }
>      }
>    }
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> #declare X_Spacing = 3;
> #declare Z_Spacing = 4;
> #declare X_Copies = 20;
> #declare Z_Copies = 30;
> #declare X_Frequency = 1;
> #declare Z_Frequency = 2;
> #declare Amplitude = 5;
>
> union {
>    MakeMany(
>      Lipid,
>      X_Spacing, Z_Spacing,
>      X_Copies, Z_Copies,
>      X_Frequency, Z_Frequency,
>      Amplitude,
>    )
> //  rotate 30*y
> }
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
>
> background { color Blue/2 }
>
> camera {
> //  orthographic
>    location <0, 1, -4>*30
>    look_at <0, -6, 0>
> }
>
> light_source {
>    <2, 1, -1>*100
>    color White
>    shadowless
> }
>
> // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

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