Development SIG Toolkit

You are not logged in. Would you like to login or register?

9/30/2019 3:18 pm  #1

Loading and adding a model to the scene graph

First create the SnModel:
SnModel* snm = new SnModel;
bool ok = snm->model()->load("../arm/hand.obj"); // here using relative path

// Another possible way to create snm is:
// GsModel* m = new GsModel();
// bool ok = m->load("../arm/hand.obj");
// SnModel* snm = new SnModel(m);

if (!ok) { gsout<<"Could Not Load!\n"; exit(1); }

// Example of how to get the bounding box of a scene shape:
GsBox b;
snm->get_bounding_box(b); // GsModel also has the same method
gsout << "bbox = " << b << gsnl;

// Adding to a group and then root scene:
SnGroup* g = new SnGroup;

Last edited by Admin (10/01/2019 10:56 am)


Board footera


Powered by Boardhost. Create a Free Forum