New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-3d-model

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-3d-model

3D models viewer with vue.js

  • 1.4.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
550
increased by13.17%
Maintainers
1
Weekly downloads
 
Created
Source

vue-3d-model

Version Build License 996.icu

vue.js 3D model viewer component, based on threejs, inspired by model-tag

一个展示三维模型的Vue组件,支持模型操作和模型点击事件,能自动缩放模型到合适大小并校正偏移,支持多种格式的模型。

Example

DEMO

Install

using npm

npm install vue-3d-model --save

Or using script tag for global use

<script src="https://unpkg.com/vue-3d-model/dist/vue-3d-model.umd.js"></script>

Or Download vue-3d-model.js and include it in your html

Usage

<template>
  <model-obj src="example/models/obj/LeePerrySmith.obj"></model-obj>
</template>
<script>
import { ModelObj } from 'vue-3d-model';
export default {
  components: { ModelObj }
}
</script>

Or

<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8"></head>
<body>
  <div id="app">
    <model-obj src="example/models/obj/LeePerrySmith.obj"></model-obj>
  </div>
<script src="vue.js"></script>
<script src="vue-3d-model.js"></script>
<script>
  new Vue({ el: '#app' });
</script>
</body>

Documents

props

proptypedefaultexample
srcstring-'./exapmle.obj'
widthnumber-300
heightnumber-300
positionobject{ x: 0, y: 0, z: 0 }{ x: 100, y: 20, z: -10 }
rotationobject{ x: 0, y: 0, z: 0 }{ x: Math.PI / 2, y: 0, z: - Math.PI / 4 }
cameraPositionobject{ x: 0, y: 0, z: 0 }{ x: 1, y: 2, z: -3 }
cameraRotationobject{ x: 0, y: 0, z: 0 }{ x: 3, y: 2, z: -1 }
scaleobject{ x: 1, y: 1, z: 1 }{ x: 2, y: 2, z: 3 }
lightsarray-
backgroundColornumber/string0xffffff0xffffff/'#f00'/'rgb(255,255,255)'
backgroundAlphanumber10.5
controlsOptionsobject-see OrbitControls Properties
crossOriginstringanonymousanonymous/use-credentials
requestHeaderobject-{ 'Authorization: Bearer token' }
outputEncodingnumberTHREE.LinearEncodingsee WebGLRenderer OutputEncoding
glOptionsobject{ antialias: true, alpha: true }see WebGLRenderer Parameters

events

event
on-mousedown
on-mousemove
on-mouseup
on-click
on-load
on-progress
on-error

Model Format Support

model formatcomponent tag
obj<model-obj>
json<model-three>
stl<model-stl>
dae<model-collada>
ply<model-ply>
fbx<model-fbx>
gltf(2.0)<model-gltf>

Browser Support

Modern browsers and IE 11.

You can click on this for more information.

TODO List

  • Support for more model formats
  • Animation
  • Post-processing

LICENSE

MIT

Keywords

FAQs

Package last updated on 15 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc