website logo
Auteur
avatar
AmiDARK

Forum » » OS4 toutes plateformes confondues » » AmiDARK Engine - 3D Progression


Posté : 08-10-2009 00:14 icone du post

Voici un petit shot de la démo du multi caméra :



EDIT:
Voici le code source de la démo:

float?XAngle?=?0.0;

void?DarkLoop(?void?){
??DESetDisplayMode(?640,?480,?32?);
??DECls();

??DELoadImage(?"Images/x4.png",?1?);
??DEMakeObjectBox(?1,?5.0,?5.0,?5.0?);
??DELoadObject(?"cube.deo",?1?);
??DEPositionObject(?1,?0.0,?0.0,?10.0?);
??DEColorObjectEx(?1,?255,?255,?255?);
??DETextureObject(?1,?1?);??
??DESaveObject(?"cube.deo",?1?);

??DEMakeObjectBox(?2,?5.0,?5.0,?5.0?);
??DEPositionObject(?2,?0.0,?5.0,?-10.0?);
??DEColorObjectEx(?2,?255,?0,?0?);
??
??DELoadObject(?"cube.deo",?3?);
??DEPositionObject(?3,?10.0,?0.0,?0.0?);
??DEColorObjectEx(?3,?0,?255,?0?);
??
??DEInstanceObject(?4,?1?);
??DEPositionObject(?4,?-10,?0.0,?0.0?);
??DEColorObjectEx(?4,?0,?0,?255?);
??
??DELoadImage(?"Images/Background.png",?2?);
??DEMakeObjectBox(?5,?512,?512,?512?);
??DESetObjectCull(?5,?0?);
??DETextureObject(?5,?2?);

??DEMakeLight(?0?);
??DEColorLightEx(?0,?255,?255,?255?);
??DEPositionLight(?0,?0.0,?20.0,?0.0?);

??DEMakeLight(?1?);
??DEPositionLight(?1,?5.0,?30.0,?0.0?);
??DEColorLightEx(?1,?255,?0,?255?);
??DESetLightRange(?1,?4096.0f?);


??DEMakeCamera(?1?);
??DEPositionCameraEx(?1,?0.0,?0.0,?0.0?);
??DERotateCameraEx(?1,?0.0,?0.0,?0.0?);
??
??DEMakeCamera(?2?);
??DEPositionCameraEx(?2,?0,?0,?32?);
??DERotateCameraEx(?2,?45,?45,?0?);
??DESetCameraRangeEx(?2,?0.1,?4096?);

??DESetCameraViewEx(?1,?0,?0,?320,?240?);
??DESetCameraViewEx(?2,?320,?0,?640,?240?);
??DESetCameraViewEx(?0,?320,?240,?640,?480?);
??
??while(?!DELoop()?){
????XAngle?=?XAngle?+?0.25;
????DERotateObject(?1,?XAngle?/?2.0,?XAngle,?0.0?);
????DERotateObject(?4,?0.0?-?(?XAngle?/?2.0?),?0.0?-?XAngle,?0.0?);
????DERotateCameraEx(?0,?0.0,?XAngle,?0.0?);

????DESync();
???}
?}






Message édité par : AmiDARK / 08-10-2009 00:20
Message édité par : AmiDARK / 08-10-2009 00:21

Cet article provient de Le site des utilisateurs francophones actuels et futurs d'AmigaOS 4.x
https://amiga-ng.org/viewtopic.php?topic=515&forum=6