Raytracing: Added function to rescale a luxrender matrix
This commit is contained in:
@@ -37,7 +37,9 @@
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/Sequencer.h>
|
||||
#include <Base/Matrix.h>
|
||||
#include <App/ComplexGeoData.h>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
|
||||
#include "PovTools.h"
|
||||
@@ -135,3 +137,19 @@ void LuxTools::writeShape(std::ostream &out, const char *PartName, const TopoDS_
|
||||
out << " \"string name\" [\"" << PartName << "\"]" << endl;
|
||||
out << "AttributeEnd # \"\"" << endl;
|
||||
}
|
||||
|
||||
std::string LuxTools::rescaleMatrix(std::string mat, float factor)
|
||||
{
|
||||
// clean the input string
|
||||
std::string matstring = mat.substr(11);
|
||||
unsigned pos = matstring.find("]");
|
||||
matstring = matstring.substr(0,pos);
|
||||
// create a matrix and rescale it
|
||||
Base::Matrix4D trans;
|
||||
trans.fromString(matstring);
|
||||
trans.scale(factor,factor,factor);
|
||||
// create output
|
||||
std::stringstream result;
|
||||
result << "Transform [" << trans.toString() << "]" << endl;
|
||||
return result.str();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user