Advertisement
alex_dot

sdf-loader.cpp

Aug 24th, 2013
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. // Snippet from sdf-loader.cpp:
  2. // for each line multiply existing matrix with the transformation matrix corresponding to the
  3. // instruction in the sdf-file (a translation matrix in this case).
  4. // Save the accumulated transformation matrix as the world transformation matrix of the object,
  5. // i.e. use object->t_matrix for transformations
  6.  
  7. if(str3 == "translate" && iss >> int1 >> int2 >> int3)
  8. {
  9.   std::map<std::string,math3d::matrix>::iterator iter = transformation_list.find(str2);
  10.   if(iter != transformation_list.end())
  11.     t_matrix = transformation_list[str2];
  12.   else
  13.     t_matrix = math3d::matrix();
  14.   transformation_list[str2] = t_matrix * math3d::make_translation(int1,int2,int3);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement