Page 1 of 1

Add Nodebox type="scaled"

PostPosted: Sun Jun 22, 2014 04:28
by spootonium
My suggestion is that - like the "leveled" type of nodebox - "scaled" nodeboxes would use param2 to store the "level" of the nodebox, and all other dimensions would be interpreted as fractions (technically multiples) of param2. This introduces a method to parametrically define a series of nodeboxes using only a single node type. Potential applications include - plants, fungi, crystals, bubbles, baloons... anything that grows, shrinks, or varies in size.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all

-- Example 1 : a simple, centre-aligned cube
nodebox = {
  type = "scaled",
  scaled = {
    -0.5 , -0.5 , -0.5 , 0.5 , 0.5 , 0.5
  }
}

-- Example 2 : an OCD-style flower node
nodebox = {
  type = "scaled",
  scaled = {
  --{  x1  ,  y1  ,  z1  ,  x2  ,  y2  ,  z2  }
    { -0.1 , -0.5 , -0.1 ,  0.1 , 0.1 ,  0.1 }, -- stem
    { -0.3 ,  0.1 , -0.3 , -0.1 , 0.3 , -0.1 }, -- petals
    { -0.3 ,  0.1 ,  0.1 , -0.1 , 0.3 ,  0.3 },
    {  0.1 ,  0.1 ,  0.1 ,  0.3 , 0.3 ,  0.3 },
    { -0.3 ,  0.1 ,  0.1 ,  0.3 , 0.3 , -0.1 }
  }
}



EDIT: Grammar.

Re: Add Nodebox type="scaled"

PostPosted: Sun Jun 22, 2014 19:35
by TenPlus1
This would be handy indeed for the nodes you just mentioned, I would enjoy using this if it came into being...

Re: Add Nodebox type="scaled"

PostPosted: Sun Jun 22, 2014 21:01
by rubenwardy
This would be handle if it was intropolated- you could make the flower grow smoothly.

Otherwise you could just do it yourself with multiple nodes already.

Re: Add Nodebox type="scaled"

PostPosted: Mon Jun 23, 2014 16:37
by philipbenr
That is actually a pretty good idea. Very handy indeed.