Render Viro3DObject from remote location
See original GitHub issue- Review the documentation: https://docs.viromedia.com/
- Search for existing issues: https://github.com/viromedia/viro
- Use the latest ViroReact release: https://docs.viromedia.com/docs/releases
Environment
Please provide the following information about your environment:
- Development OS: Mac Mojave 10.14.3
- Device OS & Version: Android 9.0 and Android 8.0
- Version: ViroReact 2.13.0 and React Native: 0.57.7
- Device(s): Huawei Mate 20 Pro and Samsung Galaxy S8
Description
Im trying render a 3d Object with Viro3DObject using url for source and resources and it doesn’t work, before try with url tried with local files and it works fine so trying find a solution i found that can be problem of the http url but it doesn’t work neither.
Reproducible Demo
My dependences are:
"dependencies": {
"axios": "0.18.0",
"jwt-decode": "2.2.0",
"native-base": "^2.11.0",
"react": "16.6.1",
"react-native": "0.57.7",
"react-native-fast-image": "^5.2.0",
"react-native-gesture-handler": "^1.1.0",
"react-native-swiper": "^1.5.14",
"react-navigation": "3.5.1",
"react-viro": "2.13.0"
}
and the way that i try to render objects is like this:
<ViroARScene onTrackingUpdated={this._onInitialized}>
<ViroAmbientLight color="#FFFFFF" />
<Viro3DObject
source={{ uri: "http://example.com/uploads/object.obj" }}
resources={[
{ uri: "http://example.com/uploads/object.mtl" },
{ uri: "http://example.com/uploads/objectTex1.jpg" },
{ uri: "http://example.com/uploads/objectTex2.jpg" }
]}
highAccuracyEvents={true}
position={[1, 3, -5]}
scale={[2, 2, 2]}
rotation={[45, 0, 0]}
type="OBJ"
transformBehaviors={["billboard"]}
/>
</ViroARScene>
the render works when i use require() like this:
<ViroARScene onTrackingUpdated={this._onInitialized}>
<ViroAmbientLight color="#FFFFFF" />
<Viro3DObject
source={require("./../public/models/object.obj")}
resources={[
require("./../public/models/object.mtl"),
require("./../public/models/objectTex1.jpg"),
require("./../public/models/objectTex2.jpg")
]}
highAccuracyEvents={true}
position={[1, 3, -5]}
scale={[2, 2, 2]}
rotation={[45, 0, 0]}
type="OBJ"
transformBehaviors={["billboard"]}
/>
</ViroARScene>
I’ve been searching some information almost a week and nothing, i hope someone can help me.
Thanks and sorry for my english.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top Results From Across the Web
Viro3DObject
The position parameter represents the position in world coordinates on the object where the click occurred. For the mapping of sources to controller...
Read more >Augmented Reality — with React-Native | by Dhara Naik
Documentation site for ViroReact, a platform for developers to rapidly create AR/VR applications using React Native… ... Augmented reality without any 3D object ......
Read more >BUILDING AN AUGMENTED REALITY MOBILE ... - IRJET
The source property of Viro3DObject accepts a remote URL or a local file resource. To specify the 3D model file type being loaded,...
Read more >Building An Augmented Reality Mobile Application Using ...
As more and more Location-based AR: Unlike the former two types of AR, to ... The source property of Viro3DObject accepts a remote...
Read more >Why Does not The 3D Model Work With Ambientlight - ADocLib
Hitfilm renders layers from bottom to top.3D models and particle sims that ... Complex 3D objects represented by Viro3DObject can have multiple materials....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@osho1278 @masierraf Hey, i have the same problem, did anyone find a solution?
I had same problem so I converted OBJ and MTL file to single GLB and placed it in models folder in server following is code to send an GLB model from server:
Server
Client