我有一个我在引擎中加载的 fbx 模型,但是当我尝试以编程方式在这个模型上应用纹理时它不起作用,但它适用于像立方体这样的原始对象。
这就是我所做的
auto fileLoaderComplete = sceneManager->assets()->loader()->complete()->connect([&](file::Loader::Ptr loader)
{
auto chair = sceneManager->assets()->symbol(FBX_MODEL_FILENAME);
//chair->addComponent(Transform::create());
auto chairMaterial = material::BasicMaterial::create();
chairMaterial->diffuseMap(sceneManager->assets()->texture(TEXTURE_FILENAME));
chair->addComponent(Surface::create(
geometry::QuadGeometry::create(sceneManager->assets()->context()),
chairMaterial,
sceneManager->assets()->effect("effect/Basic.effect")
));
chair->component<Transform>()->matrix(chair->component<Transform>()->matrix() * math::scale(math::vec3(0.005f)));
// Add the symbol to the scene
root->addChild(chair);
});
但是没有在模型上应用任何纹理。如何让它正常工作?