diff --git a/README.md b/README.md index 54b777709..78bd2fc42 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ les primitives sont: - [Cylindre-Limité](#Cylindre-Limité) - [Torus](#Torus) - [Triangle](#Triangle) +- [Obj](#Obj) les materiaux sont: - [PlainMaterial](#PlainMaterial) @@ -1393,6 +1394,95 @@ lights : +## Obj + +![image](/documentation/obj.png) + +
* + afficher ... + +```python +# obj.yaax + +# Configuration of the camera +cameras: +{ + Camera: ( + { + size = {x: 500; y = 500;}; + transform = { + position = {x = 0.0; y = -30.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + focal = 200.0; + maxThreads = -1; + filters = { + SSAAx4: ( + { + maxThreads = -1; + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of OBJ + Obj = ( + { + filePath = "./tests/obj/monkey.obj"; + transform = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 1.0; y = 1.0; z = 1.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + type = "PlainMaterial"; + shininess = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 0.0; y = -10.0; z = 0.0;}; + scale = {x = 500.0; y = 1.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 255.0; g = 126.0; b = 255.0; a = 255.0;}; + power = 2.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; +``` + +
+ ## PlainMaterial ![image](/documentation/plainmaterial1-basic.png) diff --git a/documentation/obj.png b/documentation/obj.png new file mode 100644 index 000000000..8d5ef3029 Binary files /dev/null and b/documentation/obj.png differ diff --git a/tests/documentation/obj.yaax b/tests/documentation/obj.yaax new file mode 100644 index 000000000..b6f5715e1 --- /dev/null +++ b/tests/documentation/obj.yaax @@ -0,0 +1,75 @@ +# Configuration of the camera +cameras: +{ + Camera: ( + { + size = {x: 500; y = 500;}; + transform = { + position = {x = 0.0; y = -30.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + focal = 200.0; + maxThreads = -1; + filters = { + SSAAx4: ( + { + maxThreads = -1; + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of OBJ + Obj = ( + { + filePath = "./tests/obj/monkey.obj"; + transform = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 1.0; y = 1.0; z = 1.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + type = "PlainMaterial"; + shininess = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 0.0; y = -10.0; z = 0.0;}; + scale = {x = 500.0; y = 1.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 255.0; g = 126.0; b = 255.0; a = 255.0;}; + power = 2.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; \ No newline at end of file