npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-3d-model

v1.4.1

Published

3D models viewer with vue.js

Downloads

2,384

Readme

vue-3d-model

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

| prop | type | default | example | | --------------- |---------------|----------------------|--------------------------------------------|
| src | string | - | './exapmle.obj' | | width | number | - | 300 | | height | number | - | 300 | | position | object | { x: 0, y: 0, z: 0 } | { x: 100, y: 20, z: -10 } | | rotation | object | { x: 0, y: 0, z: 0 } | { x: Math.PI / 2, y: 0, z: - Math.PI / 4 } | | cameraPosition | object | { x: 0, y: 0, z: 0 } | { x: 1, y: 2, z: -3 } | | cameraRotation | object | { x: 0, y: 0, z: 0 } | { x: 3, y: 2, z: -1 } | | scale | object | { x: 1, y: 1, z: 1 } | { x: 2, y: 2, z: 3 } | | lights | array | - | | | backgroundColor | number/string | 0xffffff | 0xffffff/'#f00'/'rgb(255,255,255)' | | backgroundAlpha | number | 1 | 0.5 | | controlsOptions | object | - | see OrbitControls Properties | | crossOrigin | string | anonymous | anonymous/use-credentials | | requestHeader | object | - | { 'Authorization: Bearer token' } | | outputEncoding | number | THREE.LinearEncoding | see WebGLRenderer OutputEncoding | | glOptions | object | { 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 format | component 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