Interactive 3D model without WebGL for iOS

2020-07-14 05:55发布

问题:

I want to make something similar to this - http://appserv.kfshrc.edu.sa/Default/Health/Anantomy.aspx, but without using flash and able to work on Mobile Safari on iPad.

I played with WebGL, it's great but doesn't work on iOS yet (though it is there in Mobile Safari, but it's just for iAds). I also tried with CSS 3D transformations, but it doesn't work properly. So, what can I use to implement this for iOS Mobile Safari?

回答1:

I think it would be worth looking into three.js, a JavaScript 3d library which allows you to choose canvas, SVG or WebGL as the render target. three.js should make building something like the example you point to in your question fairly straightforward.

According to this thread, there have been some issues with canvas rendering in mobile Safari, but that was over a year ago so it may have been resolved. You could try some of the canvas examples on the three.js site to get an idea of the performance in mobile Safari as of today.

@Nicholas Kyriakides has also pointed out that in his experience SVG render mode has been buggy and not performed as well as WebGL.



回答2:

I've had some luck in the past using this: https://code.google.com/p/jsc3d/ It worked on everything i tried on, i just had to change some javascript to make it interactive with mobile devices but i think now they took my changes and it should work for touch events.

That rendered with Chrome, Safari, Firefox, IE<9, IE>=9, Android Phone, Android Tablet, iPad, iPhone.

However performance is poor. But its cool i created a model in google sketchup, exported the obj file and then rendered it multiplatform with textures.