Signup Issues have been resolved (hopefully). If you have previously had issues signing up for the forum, please try again.
0 Members and 2 Guests are viewing this topic.
//############################################################################// NOTE: The frame set effect named "spencer" is for the specific purpose of creating// an invalid form of the ILDA file format in an attept to correct the behaviour// of a specific laser projector that is known to have a built in DAC with bad firmware!// It is NOT intended to produce any valuable special effect for any other purpose!//############################################################################int spencer(LaserBoy_frame_set* p_frame_set){ bool in_blank = false; int frame_count, vertex_count; LaserBoy_frame frame(p_frame_set->p_space); LaserBoy_frame_set out (p_frame_set->p_space); //------------------------------------------------------------------------ for(frame_count = 0; frame_count < p_frame_set->number_of_frames(); frame_count++) { if(p_frame_set->at(frame_count).number_of_vertices() >= 2) { frame += p_frame_set->at(frame_count).at(0); for(vertex_count = 0; vertex_count < p_frame_set->at(frame_count).number_of_vertices() - 1; vertex_count++) { frame += p_frame_set->at(frame_count).at(vertex_count); frame.back().r = p_frame_set->at(frame_count).at(vertex_count + 1).r; frame.back().g = p_frame_set->at(frame_count).at(vertex_count + 1).g; frame.back().b = p_frame_set->at(frame_count).at(vertex_count + 1).b; frame.back().c = p_frame_set->at(frame_count).at(vertex_count + 1).c; frame.back().k = p_frame_set->at(frame_count).at(vertex_count + 1).k; if( p_frame_set->at(frame_count).at(vertex_count + 1).is_blank() // if the next vrtx (not added yet) is blank && in_blank == false // we're not already in blank ) { in_blank = true; // we're now in a blank frame += p_frame_set->at(frame_count).at(vertex_count + 1); // add the next vrtx frame.back().unblank(); // unblank it // it will be added again as a blank in the next itteration of the for loop. } else if(p_frame_set->at(frame_count).at(vertex_count + 1).is_lit()) // we're out of blank { in_blank = false; } } frame += p_frame_set->at(frame_count).back(); // double the last vrtx frame += p_frame_set->at(frame_count).back(); // save_as_ild handles setting the last vrtx bit. } out += frame; frame.clear(); } //------------------------------------------------------------------------ out.save_as_ild(LASERBOY_ILD_SHARE + "spencer.spn"); return LASERBOY_OK;}//############################################################################
//############################################################################// NOTE: The frame set effect named "spencer" is for the specific purpose of creating// an invalid form of the ILDA file format in an attept to correct the behaviour// of a specific laser projector that is known to have a built in DAC with bad firmware!// It is NOT intended to produce any valuable special effect for any other purpose!//############################################################################int spencer(LaserBoy_frame_set* p_frame_set){ bool in_blank = false; int frame_count, vertex_count; LaserBoy_frame frame(p_frame_set->p_space); LaserBoy_frame_set out (p_frame_set->p_space); //------------------------------------------------------------------------ for(frame_count = 0; frame_count < p_frame_set->number_of_frames(); frame_count++) { if(p_frame_set->at(frame_count).number_of_vertices() >= 2) { frame += p_frame_set->at(frame_count).at(0); for(vertex_count = 0; vertex_count < p_frame_set->at(frame_count).number_of_vertices() - 1; vertex_count++) { frame += p_frame_set->at(frame_count).at(vertex_count); frame.back().r = p_frame_set->at(frame_count).at(vertex_count + 1).r; frame.back().g = p_frame_set->at(frame_count).at(vertex_count + 1).g; frame.back().b = p_frame_set->at(frame_count).at(vertex_count + 1).b; frame.back().c = p_frame_set->at(frame_count).at(vertex_count + 1).c; frame.back().k = p_frame_set->at(frame_count).at(vertex_count + 1).k; if( p_frame_set->at(frame_count).at(vertex_count + 1).is_blank() // if the next vrtx (not added yet) is blank && in_blank == false // we're not already in blank ) { in_blank = true; // we're now in a blank frame += p_frame_set->at(frame_count).at(vertex_count + 1); // add the next vrtx frame.back().unblank(); // unblank it // it will be added again as a blank in the next itteration of the for loop. } else if(p_frame_set->at(frame_count).at(vertex_count + 1).is_lit()) // we're out of blank { in_blank = false; } } frame += p_frame_set->at(frame_count).back(); // double the last vrtx frame += p_frame_set->at(frame_count).back(); // save_as_ild handles setting the last vrtx bit. } //------------------------------------------------------------------------ // if this frame is 2D format 1 promote it to 3D format 0. if(frame.is_2D()) for(vertex_count = 0; vertex_count < frame.number_of_vertices(); vertex_count++) frame.at(vertex_count).z = 1000; // force it to 3D //------------------------------------------------------------------------ out += frame; frame.clear(); } //------------------------------------------------------------------------ out.save_as_ild(LASERBOY_ILD_SHARE + "spencer.spn"); return LASERBOY_OK;}//############################################################################