TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Nov 2017 |
SwiftSwift Version | 4.0 |
SPMSupports SPM | ✗ |
Maintained by Koldo Ruiz.
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 9.0 or higher.
Bv3dPreview is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'Bv3dPreview'
Or you can drag the Bv3dPreview.swift directly into your project and import the library whenever you need it.
1.- From storyboard
Drag an UIView and asign his class to Bv3dPreview
.
On the controller connect an @IBOutlet to the UIView you have created.
Finally, use configure the obj model and the textures(optional)
2.- From code
guard let objUrl = Bundle.main.url(forResource: "Fighter", withExtension: "obj") else {
return }
let model3DViewer = Bv3dPreview(from: objUrl, textures: [
.baseColor:"Fighter_Diffuse_25.jpg",
.specular:"Fighter_Specular_25.jpg",
.emission:"Fighter_Illumination_25.jpg"])
codeBv3dPreview.frame = CGRect(x: 0, y: 0, width: view.frame.size.width, height: view.frame.size.height)
view.addSubview(model3DViewer)
koldo92, [email protected]
Bv3dPreview is available under the MIT license. See the LICENSE file for more info.