[Plib-users] load 3ds
Brought to you by:
sjbaker
From: lahiani m. <lah...@cs...> - 2004-04-24 19:05:31
|
Hello 1. I try to write class that use like interface . I mean the class load 3ds object and the user can ask for : GetVertexes() ------ return vector ( or something else) with all the vertexes GetNormals()--------return vector with all the normals GetPolygon()--------return all the polygon that make the object And so on... The constractor look like: ssgEntity *obj ssgRoot scene; Parser(file_name) { obj = ssgLoad3ds(file_name); scene -> addKid ( obj ) ; some other things } now I want to use object and get all the vertex text coordinate normal ... how can I do it ??????? how can I search at the tree????? i try to use this func to print all to file but it isn't work good what the meaning of the int 12 in leaf -> print(fdest2,"",12); void parseFile::readScene(ssgEntity* e) { if ( e -> isAKindOf ( ssgTypeBranch() ) ) { ssgBranch *br = (ssgBranch *) e ; for ( int i = 0 ; i < br -> getNumKids () ; i++ ) { readScene ( (ssgEntity*)br -> getKid ( i ) ) ; } } else if ( e -> isAKindOf ( ssgTypeLeaf() ) ) { ssgLeaf* leaf = (ssgLeaf *) e ; //e->print(); leaf -> print(fdest2,"",12); } } 2. if I have 3ds object let say cub that each vertex in different color. How can I get the color of each vertex. Thanks Moti lahiani |