Skip to content

Repository files navigation

Bv3dPreview

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 9.0 or higher.

Installation

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.

Usage

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)

Author

koldo92, koldo@byvapps.com

License

Bv3dPreview is available under the MIT license. See the LICENSE file for more info.

About

A SCNView that displays a 3D model. Lightweight, simple and flexible.

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages