From ac0a9194df52547b2b211a5a68603368db43dce5 Mon Sep 17 00:00:00 2001 From: Xavier Mitault Date: Thu, 11 May 2023 20:32:53 +0200 Subject: [PATCH] [Feat] (Docs) : docs --- README.md | 90 +++++++++++++++++++++++++++++++++++ documentation/obj.png | Bin 0 -> 5476 bytes tests/documentation/obj.yaax | 75 +++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 documentation/obj.png create mode 100644 tests/documentation/obj.yaax 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 0000000000000000000000000000000000000000..8d5ef3029f24f11ddcbe166037cbad4b7d3a2e56 GIT binary patch literal 5476 zcmeHL`(Kjh`=`TZTcy%GWhfi=Q8JV0V0eO=kZa2vshLZ3YHH?;k!X3s$|Wc&eLuFc zQYqZBB+;@&MKPzsmSr+#cxFi|iKK*_1mXL%*Z1%be17bCJ@@OrUf1(H_kG>h@qInT z-yROx_^I=!AP{Kd!LP7KK%iAi@5j220Z#u*X$df`$~Y3TAH*4eya9pi*B-VbTkYR;y_IM)M$?bXGY?p^|7uG!Q`)|dd_nR zj*VfH2gc4ub=B2Gs7!D0e+|twAQmrEZ}pTfM?4XdOnvJ*w~d}`_bFk~)?J_;TI-V4 zo4(q7n*^y%9b+@s2fY45{$p4=>~ALQpRWSLd)>)Qe`Kwr z-RcP>~e3}d;FeHErK$!eTp^vX;9JS-dfb30k7p;DjjugOIG&roLz$g)A_M@`ZjiR{nmqcfs=5D9b zuQszaWUb5FLH7gGm@+{W2A!?t-K}e`j1bdka-Mt9ZHALu{VAfoiD>x-TPk`S+K~$^ z;N!^slqd2VhhDTkd%{HxEsv9)ir`zH3#=B3XDwgU=OADuck5HJ_+C^w(weX#7%JO| z?R6q>OY3WJfz>!HSVMLNZr~sl63ZrlPjcc=Ojm3|6bKt8-ESNmMD<_nLn8VspECub zeFgSIWPZsxJ1~;7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3SY^&fn;>MO`pR0}@s(E?RUll&?i5@deh2wUGE|GS)LjrV>T7uLn z8{$$RLOCE4bH#RgnC?3d2ey8h71}{D20xlm7V;_8QA7%@CC!JN^hDw=Z>lXK(e9+z zz8OVO4&(z^quu95OWCWdx~U7ie*sTNImZK;lbO1An)8j{48~if1K1|{iZw6vJ)O2E z9U$Mc%VbXJU51qjuBQEo_LF~loTkJgQfrj3ezmR;Xf#H&`EP-KLg}|&_Wk?ARi;a4 zTXtG!Roq&GNsNcgy9ZgFU%S=?w8@tIx1(2S;e?yKDVYD#EzLpD{T56f{vvMsqyHuM zuQxgW|LdTyz8t*3cqezBcL=gV*Dn~)oy~I2mr6Cif|x;r@l-n;So2E>3*KVRPR`9G z>E)zD?iCFb@9%fl^Z1~@)kBf?@7os?<+D)9X>!GN7M#VYXA_UDM@iQi#mo2Hu-8h-;aw*vJHHf9znq@Ct5o zu4d0%eMu_8GPiE!R8(79cbBWurWiHv1DNEowXyN~OAX>8V)XL0Tfs+|pQ10*iQ-j2 zsrf%eyg%6o#s_`;Ph5O(hyPGCTqv*#_wrJwe)UWN{2aATI(9HQG!*0s(CdKl{`xb# Q;{9|GcNojr|NX`P20uO?TmS$7 literal 0 HcmV?d00001 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