//======================================= // Constructor //--------------------------------------- Spotlight::Spotlight(ParamList parameters) { int i; from=Point3(0,0,0); to=Point3(0,0,1); intensity=1; coneangle=0.5*30; conedeltaangle=0.5*5; beamdistribution=2; colour=Colour(1,1,1); if (parameters.Exists("from")) from=parameters.Vector("from"); if (parameters.Exists("to")) to=parameters.Vector("to"); if (parameters.Exists("intensity")) intensity=parameters.Float("intensity"); if (parameters.Exists("color")) colour=parameters.Vector("color"); if (parameters.Exists("coneangle")) coneangle=0.5*parameters.Float("coneangle"); if (parameters.Exists("conedeltaangle")) conedeltaangle=0.5*parameters.Float("conedeltaangle"); if (parameters.Exists("beamdistribution")) beamdistribution=parameters.Float("beamdistribution"); from=RiGlobal.tWorldToCamera*RiCurrent.transform*from; to=RiGlobal.tWorldToCamera*RiCurrent.transform*to; }
void CameraOptions::RiProjection(char *name,ParamList parameters) { if (!strcmp(name,"orthographic")) cameraProjection=RtOrthographic; else { if (!strcmp(name,"perspective")) { cameraProjection=RtPerspective; if (parameters.Exists("fov")) { fieldOfView=parameters.Float("fov"); } } else RiError("Projection type `%s' not understood",name); } }