Author: Not specified Language: c
Description: Not specified Timestamp: 2013-06-22 10:20:48 +0000
View raw paste Reply
  1. Transformation_t rootTransformation;
  2. Transformation_identity( &rootTransformation );
  3. DAGTransformation_t *root = DAGTransformation_new( &rootTransformation );
  4.  
  5. Transformation_t rot90;
  6. Transformation_rotationY( &rot90, 90.f )
  7. DAGTransformation *rot90Node = DAGTransformation_new( &rot90 );
  8.  
  9. Transformation_t rot180;
  10. Transformation_rotationY( &rot180, 180.f )
  11. DAGTransformation *rot180Node = DAGTransformation_new( &rot180 );
  12.  
  13. DAGTransformation_addChild( root, rot90 );
  14. DAGTransformation_addChild( root, rot180 );
  15. DAGTransformation_addChild( root180, rot90 );
  16.  
  17. Transformation_t translate;
  18. Transformation_translation( &translate, 5, 0, 0 );
  19. DAGTransformation_t *translateNode = DAGTransformation_new( &translate );
  20.  
  21. DAGNode_t *sphere = DAGNode_mkSphere();
  22. DAGTransformation_addChild( translateNode, sphere );
  23. DAGTransformation_addChild( root, translateNode );
  24. DAGTransformation_addChild( rot90, translateNode );
  25. DAGTransformation_addChild( rot180, translateNode );
View raw paste Reply