May I ask about the problem with model loading
When I was studying the examples in the Optix tutorial (optimx7course master), I probably understood that it was through a model.cpp file to correspond the triangles and texture maps in the model, and then put them into SBT for binding. Then, I just needed to instantiate the model class in the main function and pass in the model address, as shown below.
Model * model=loadOBJ (“…/…/models/sponza. obj”);
But after downloading a relatively complex example, I couldn’t quite sort out the logic of the code and couldn’t find where to load the model. The name of this example is OptiX Raytracer master. The example I am seeing now is adapted by someone else, and it is done in the following way:
auto tianhuaban_checker = std::make_shared(“Textures4\7.jpg”);
auto tianhuaban_diffuse = std::make_shared(tianhuaban_checker);
auto tianhuaban_matrix = sutil::Matrix4x4::translate(make_float3(-170.0f, 425.0f, -150.0f))
* sutil::Matrix4x4::rotate(M_PIf, make_float3(0.0f, 0.0f, 0.0f));
auto tianhuaban_model_ps = PrimitiveInstance(Transform());
auto tianhuaban_model = createTriangleMesh(“model\m_model4\tianhuaban.obj”);
tianhuaban_model_ps.addPrimitive(tianhuaban_model, tianhuaban_diffuse);
scene.addPrimitiveInstance(tianhuaban_model_ps);
Divide the model into many blocks based on different materials and import them one by one. I also learned how to import the model, but when encountering a very complex model, I don’t know what to do. I would like to ask how to import the model in this example (OptiX Raytracer master). I don’t have the original code for this instance, but what I see is the modified version. Could you please see if you can find this instance, Then teach me how to import the model. I feel that this example is much more complex than the tutorial (optimx7 course master), and I am a bit confused about the logical relationships between the various files.
Thank you!!