#macro

ppujuguet@diaspora-fr.org

Petits akènes de cardon occitan prêts à s'envoler... photographiés en allant chercher du petit bois de bonne heure ce matin. Et oui, c'est bête mais quand on bucheronne on néglige souvent le petit bois bien pratique pour redémarrer l'insert le matin... Alors pardi... on le cherche parfois tôt le matin ... et en tong. :>)
ps : Le bonheur du plein format parce que là je travaille au 28:75 mm macro (et non stabilisé) alors après, je rogne, je rogne.

#photo
#maphoto
#mywork
#macro
#photorapprochee

psychmesu@diaspora.glasswings.com

https://mastodonapp.uk/@BjornIdle/111705843766893976 BjornIdle@mastodonapp.uk - A Red Damselfly (Xanthocnemis zealandica) clings onto the tip of a reed shaft.

I'd love to say I deliberately chose a reed that had the same colours on it as the damselfly, but this is just where this one happened to land. And to be honest, I've only just noticed it myself... 🤔

#MacroPhotography #Insects #Damselfly #Dragonfly #Macro #Nature #NaturePhotography #InsectPhotography

jamaisplus37@diaspora.psyco.fr
zebulon_1er@diasp.org

#cgi #povray
ping @tTh, @Nunuche Follette, @inco gnito, ... :)

Bois et Résine Epoxyde dans povray

Après avoir un peu fait joujou avec mon dé, à lui essayer tout plein de textures diverses et variées... j'ai repensé à ces vidéos, postées par @Nunuche Follette, sur des objets en bois flotté noyé dans de la résine époxyde.

J'ai donc tout naturellement voulu faire un dé de la sorte.


Créer un objet qui sera inséré, comme un bout de bois, à l'aide d'une isosurface {} et une fonction f_granite comme générateur de forme, ce n'est pas le plus compliqué :
```povray
/*
** Gros dé en bois et résine époxyde
*/

#version 3.7;

#include "colors.inc"
#include "consts.inc"
#include "functions.inc"
#include "transforms.inc"

#include "isocsg/iso_csg.inc" // ISO_CSG, voir http://imagico.de/pov/ic/index.php

#declare EPSILON = 1e-4; // toute petite valeur, pour les marges

#ifndef (ASPECT_RATIO)
#declare ASPECT_RATIO = image_width / image_height;
#end

#declare AMBIENT_LIGHT = rgb 1/3;

#default {
finish { ambient AMBIENT_LIGHT }
}

global_settings {
charset utf8
assumed_gamma srgb
ambient_light AMBIENT_LIGHT
}

#declare SEED = seed(639663322);

#macro V3Rand()
< rand(SEED), rand(SEED), rand(SEED) >
#end

#macro V3SRand()
(V3Rand() * 2 - 1)
#end

#declare Size = 5; // taille du dé : 5 cms

#declare Size2 = Size / 2;
#declare Size2E = Size2 + EPSILON;

#local f1 = IC_Transform(f_granite,
transform {
scale Size * pi
translate V3SRand() * 100
rotate V3SRand() * 180
}
)

isosurface {
function { f1(x,y,z) * 0.4 - 0.075 }
contained_by { box { -Size2E, Size2E } }
accuracy 0.001
evaluate 1.1*0.6, sqrt(1/0.6), 0.7
pigment { White }
translate y * Size2E
}

// ground
plane { y, 0 pigment { Gray } }

camera {
location -z * 10
look_at o
direction z * 10

sky y
right x * ASPECT_RATIO
up y

translate -z * 100
rotate x * 30
rotate y * -60
translate y * Size2
}

// light intensity factor
// a: light distance (from object : light pos - object pos)
// b: light fade distance
// c: light fade power
#declare f_LightIntensityFactor = function(a,b,c) { pow(a/b + 1, c) / 2 }

#local Pos = vtransform(< -1, 2, -1 > * 100, transform { rotate y * -60 });
#local Int = f_LightIntensityFactor(vlength(Pos), 200, 1.5);
light_source {
Pos
color White * 1/3 * Int
fade_distance 200
fade_power 1.5
}

#local Pos = vtransform(< -1, 1, -1 > * 100, transform { rotate y * -150 });
#local Int = f_LightIntensityFactor(vlength(Pos), 100, 1.5);
light_source {
Pos
color White * 2/3 * Int
fade_distance 100
fade_power 1.5
}
```

Délimité par un cube.


Sauf que mon conteneur, ce n'est pas juste un simple cube (contained_by { box { -Size2E, Size2E } }), mais un dé, fait de l'intersection d'une sphère et d'un cube à laquelle on a enlevé des sphères écrasées pour y numéroter les faces de 1 à 6.

On a alors simplement l'idée d'utiliser le dé, fait en CSG classique, que l'on va intersecter (je ne sais pas si ça se dit) avec le morceau de bois précédemment créé en isosurface :

/*
** Gros dé en bois et résine époxyde
*/

#version 3.7;

#include "colors.inc"
#include "consts.inc"
#include "functions.inc"
#include "transforms.inc"

#include "isocsg/iso_csg.inc" // ISO_CSG, voir http://imagico.de/pov/ic/index.php

#include "ftz_dice.inc"

#declare EPSILON = 1e-4; // toute petite valeur, pour les marges

#ifndef (ASPECT_RATIO)
  #declare ASPECT_RATIO = image_width / image_height;
#end

#declare AMBIENT_LIGHT = rgb 1/3;

#default {
  finish { ambient AMBIENT_LIGHT }
}

global_settings {
  charset utf8
  assumed_gamma srgb
  ambient_light AMBIENT_LIGHT
}

#declare SEED = seed(639663322);

#macro V3Rand()
  < rand(SEED), rand(SEED), rand(SEED) >
#end

#macro V3SRand()
  (V3Rand() * 2 - 1)
#end

#declare Size = 5; // taille du dé : 5 cms

#declare Size2  = Size / 2;
#declare Size2E = Size2 + EPSILON;

#local f1 = IC_Transform(f_granite,
   transform {
    scale Size * pi
    translate V3SRand() * 100
    rotate V3SRand() * 180
  }
)

intersection {
  isosurface {
    function { f1(x,y,z) * 0.4 - 0.075 }
    contained_by { box { -Size2E, Size2E } }
    accuracy 0.001
    evaluate 1.1*0.6, sqrt(1/0.6), 0.7
  }
  FTZ_Dice(
    Size,
    material {},
    material {}
  )
  pigment { White }
  translate y * Size2E
}

// ground
plane { y, 0 pigment { Gray } }

camera {
  location  -z * 10
  look_at    o
  direction  z * 10

  sky    y
  right  x * ASPECT_RATIO
  up     y

  translate -z * 100
  rotate x * 30
  rotate y * -60
  translate y * Size2
}

// light intensity factor
// a: light distance (from object : light pos - object pos)
// b: light fade distance
// c: light fade power
#declare f_LightIntensityFactor = function(a,b,c) { pow(a/b + 1, c) / 2 }

#local Pos = vtransform(< -1, 2, -1 > * 100, transform { rotate y * -60 });
#local Int = f_LightIntensityFactor(vlength(Pos), 200, 1.5);
light_source {
  Pos
  color White * 1/3 * Int
  fade_distance 200
  fade_power 1.5
}

#local Pos = vtransform(< -1, 1, -1 > * 100, transform { rotate y * -150 });
#local Int = f_LightIntensityFactor(vlength(Pos), 100, 1.5);
light_source {
  Pos
  color White * 2/3 * Int
  fade_distance 100
  fade_power 1.5
}

Voilà, c'est déjà mieux. Mon morceau de bois ne dépassera pas du dé conteneur.


Reste plus qu'à utiliser une jolie texture bois pour cette partie... disons T_Wood13 (de woods.inc fourni avec povray) :

/*
** Gros dé en bois et résine époxyde
*/

#version 3.7;

#include "colors.inc"
#include "consts.inc"
#include "functions.inc"
#include "transforms.inc"
#include "woods.inc"

#include "isocsg/iso_csg.inc" // ISO_CSG, voir http://imagico.de/pov/ic/index.php

#include "ftz_dice.inc"

#declare EPSILON = 1e-4; // toute petite valeur, pour les marges

#ifndef (ASPECT_RATIO)
  #declare ASPECT_RATIO = image_width / image_height;
#end

#declare AMBIENT_LIGHT = rgb 1/3;

#default {
  finish { ambient AMBIENT_LIGHT }
}

global_settings {
  charset utf8
  assumed_gamma srgb
  ambient_light AMBIENT_LIGHT
}

#declare SEED = seed(639663322); // changez ce nombre, et toute la chaîne de nombres aléatoires appelés sera différente

#macro V3Rand()
  < rand(SEED), rand(SEED), rand(SEED) >
#end

#macro V3SRand()
  (V3Rand() * 2 - 1)
#end

#declare Size = 5; // taille du dé : 5 cms

#declare Size2  = Size / 2;
#declare Size2E = Size2 + EPSILON;

#local f1 = IC_Transform(f_granite,
   transform {
    scale Size * pi
    translate V3SRand() * 100
    rotate V3SRand() * 180
  }
)

intersection {
  isosurface {
    function { f1(x,y,z) * 0.4 - 0.075 }
    contained_by { box { -Size2E, Size2E } }
    accuracy 0.001
    evaluate 1.1*0.6, sqrt(1/0.6), 0.7
  }
  FTZ_Dice(
    Size,
    material {},
    material {}
  )
  texture {
    T_Wood13
    translate V3SRand() * 1e4
    rotate V3SRand() * 180
  }
  translate y * Size2E
}

// ground
plane { y, 0 pigment { Gray } }

camera {
  location  -z * 10
  look_at    o
  direction  z * 10

  sky    y
  right  x * ASPECT_RATIO
  up     y

  translate -z * 100
  rotate x * 30
  rotate y * -60
  translate y * Size2
}

// light intensity factor
// a: light distance (from object : light pos - object pos)
// b: light fade distance
// c: light fade power
#declare f_LightIntensityFactor = function(a,b,c) { pow(a/b + 1, c) / 2 }

#local Pos = vtransform(< -1, 2, -1 > * 100, transform { rotate y * -60 });
#local Int = f_LightIntensityFactor(vlength(Pos), 200, 1.5);
light_source {
  Pos
  color White * 1/3 * Int
  fade_distance 200
  fade_power 1.5
}

#local Pos = vtransform(< -1, 1, -1 > * 100, transform { rotate y * -150 });
#local Int = f_LightIntensityFactor(vlength(Pos), 100, 1.5);
light_source {
  Pos
  color White * 2/3 * Int
  fade_distance 100
  fade_power 1.5
}


Il ne reste plus qu'à ajouter le dé en résine époxyde :

/*
** Gros dé en bois et résine époxyde
*/

#version 3.7;

#include "colors.inc"
#include "consts.inc"
#include "finish.inc"
#include "functions.inc"
#include "transforms.inc"
#include "woods.inc"

#include "isocsg/iso_csg.inc" // ISO_CSG, voir http://imagico.de/pov/ic/index.php

#include "ftz_dice.inc"

#declare EPSILON = 1e-4; // toute petite valeur, pour les marges

#ifndef (ASPECT_RATIO)
  #declare ASPECT_RATIO = image_width / image_height;
#end

#declare AMBIENT_LIGHT = rgb 1/3;

#default {
  finish { ambient AMBIENT_LIGHT }
}

global_settings {
  charset utf8
  assumed_gamma srgb
  ambient_light AMBIENT_LIGHT
}

#declare SEED = seed(639663322);

#macro V3Rand()
  < rand(SEED), rand(SEED), rand(SEED) >
#end

#macro V3SRand()
  (V3Rand() * 2 - 1)
#end

#declare Size = 5; // taille du dé : 5 cms

#declare Size2  = Size / 2;
#declare Size2E = Size2 + EPSILON;

#local f1 = IC_Transform(f_granite,
   transform {
    scale Size * pi
    translate V3SRand() * 100
    rotate V3SRand() * 180
  }
)

#local o_Wood = intersection {
  isosurface {
    function { f1(x,y,z) * 0.4 - 0.075 }
    contained_by { box { -Size2E, Size2E } }
    accuracy 0.001
    evaluate 1.1*0.6, sqrt(1/0.6), 0.7
  }

  FTZ_Dice(
    Size,
    material {},
    material {}
  )

  texture {
    T_Wood13
    translate V3SRand() * 1e4
    rotate V3SRand() * 180
  }
}

#local o_Dice = FTZ_Dice(Size,
  // résine époxyde légèrement bleue
  material {
    #local C1 = < 186, 229, 255 > / 255;
    #local C2 = < 117, 157, 181 > / 255;

    #local T = 0.995; // transparence totale (filtrage compris)
    #local F = 0.2; // filtrage seul

    texture {
      pigment { color C1 filter F transmit (T - F) }

      finish {
        diffuse 0.15
        specular 0.8
        roughness 0.001
        reflection {
          C1/17
          fresnel on
        }
      }
    }

    interior {
      ior 1.5
      //dispersion 1.0125 // très long à rendre, avec de la dispersion
      fade_color C2
      fade_distance Size * 0.85
      fade_power 1001
    }
  },

  // matériau pour les nombres
  material {
    texture {
      pigment { color White * 0.995 }
      finish { Dull }
    }
  }
);

union {
  object { o_Wood }
  object { o_Dice }
  translate y * Size2E
}

// ground
plane { y, 0 pigment { Gray } }

camera {
  location  -z * 10
  look_at    o
  direction  z * 10

  sky    y
  right  x * ASPECT_RATIO
  up     y

  translate -z * 100
  rotate x * 30
  rotate y * -60
  translate y * Size2
}

// light intensity factor
// a: light distance (from object : light pos - object pos)
// b: light fade distance
// c: light fade power
#declare f_LightIntensityFactor = function(a,b,c) { pow(a/b + 1, c) / 2 }

#local Pos = vtransform(< -1, 2, -1 > * 100, transform { rotate y * -60 });
#local Int = f_LightIntensityFactor(vlength(Pos), 200, 1.5);
light_source {
  Pos
  color White * 1/3 * Int
  fade_distance 200
  fade_power 1.5
}

#local Pos = vtransform(< -1, 1, -1 > * 100, transform { rotate y * -150 });
#local Int = f_LightIntensityFactor(vlength(Pos), 100, 1.5);
light_source {
  Pos
  color White * 2/3 * Int
  fade_distance 100
  fade_power 1.5
}

Et voilà.