The ability to view the Model.JS model is possible in the telephone hesitation?

I am trying to make a very simple 3D model viewer in a phonegap application for use on iPhone 4. I use three.js, which works great when I make a simple website. The problem is that when I try to execute this on the phone, the 3D object does not appear. Simple geometric shapes, such as a cube and a cylinder, will be loaded onto the canvas, but obj files will not.

I use objLoader to enter the .obj file and just in case I have all the relevant files in the same directory in the application. I think the problem may be using webGL on iOS, but I'm not sure.

Many thanks for your help. If anyone has any suggestions for creating a viewer model in a phone splash screen for display in iOS, I would be happy to hear them.

+4
source share
4 answers

Since very few mobile browsers support WebGL , at the moment I decided to use the canvas to render 3D models. I used a simple 3D object viewer called JSC3D to create a model in PhoneGap on iOS. It can use webGL, but I just went with rendering using a 2D canvas.

I tested my application on iPhone 4, and the result was that the model took 2 to 5 seconds to load, and when you go to rotate the object, it takes some time to redraw it depending on how complex it is. Although this is not the most satisfactory result, he really did the job. I am going to try it on a more advanced Android phone and I will let you know the result.

+1
source

I suggest you try using the Intel XDK if you are packing on iphone, but using AIDE Phonegap for Android telephony. Make sure you use only var renderer = new THREE.CanvasRenderer(); and avoid using Everything related to WebGL is not supported on most devices except BB Playbook and BB 10.

+1
source

I think the iOS rendering ability is better than Android, some scenes render well in iOS, but not in Android.

Typically, mobiles have more rendering capabilities than a mobile application. I use firefox to demonstrate dem.js obj demo, it works well. But when I use webview in the application, it does nothing.

I am making an Android application to display stl models. At first, when I use a mobile browser to render the scene, it does not display the full scene, and when I remove the shadow effect, it displays. Then I try to use webview with WebGlRenderer or CanvasRenderer, no work. The last thing I mean is the XWalkView for crosswalk web engine, which can be used as an addition to the application to replace the web view, I also close the shadow effect, I look good.

You can send this answer for more information.

Here is the rendering result. enter image description here

0
source

You should definitely not use the three.js WebGL renderer, as it is not supported on iOS. Try Canvas or SVG renderer.

-one
source

Source: https://habr.com/ru/post/1494293/


All Articles