Using multiple canvases within containers #572
SunbeamRapier
started this conversation in
General
Replies: 1 comment 1 reply
-
When I console.log the contents of the nodes, scenes & groups I get sensible info for the first function, and "undefined" for the items in the Number4 function. Changing the sequence of the functions makes no difference. I am thinking that the constants scene and group are perhaps reserved words and that react-three-fiber does not recognise the scene2 and group2 objects. How then can I direct the output from the Number4 function to the second canvas? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to position three models, each of which are rotated differently. I envisaged that I would create three functions to import and animate each of the three models and then export three canvases sized appropriately.
But this is not working for me. In the current test I have two canvases and models. I do get the two canvases but the second canvas has no model.
// This is the code for the second model (the first model is the same code, without the "2" for scene, nodes etc...
function Number4() {
console.log("Function Number4 running");
const group2 = useRef();
const { scene2 } = useLoader(GLTFLoader, "/models/BigW_only_mesh13July_centredScale2.glb");
});
return (
);
}
return (
);
}
// This is the export code:
// I am using the same model in both functions for testing.
I get this error in Chrome Dev Tools:
index.js:1 The above error occurred in the component:
in primitive (at Logo.js:58)
in group2 (at Logo.js:57)
in Number4 (at Logo.js:84)
in Suspense (at Logo.js:83)
in Canvas
Beta Was this translation helpful? Give feedback.
All reactions