lottery
🎉🌟✨🎈年会抽奖程序,基于 Express + Three.js的 3D 球体抽奖程序,奖品🧧🎁,文字,图片,抽奖规则均可配置,😜抽奖人员信息Excel一键导入😍,抽奖结果Excel导出😎,给你的抽奖活动带来全新酷炫体验🚀🚀🚀
JavaScript★ 4.6k
A 3D model viewer component based on react.js 一个基于react.js的组件化3d模型查看工具
git clone https://github.com/dwqdaiwenqi/react-3d-viewer.gitdwqdaiwenqi/react-3d-viewerEnglish| 简体中文
A 3D model viewer component based on react.js. Demo located at https://dwqdaiwenqi.github.io/react-3d-viewer/site/
.setState() method<DirectionLight/> and <AmbientLight/> light components - other components will be provided in the future.Get react-3d-viewer through npm or cdn:
npm i react-3d-viewer
import {OBJModel} from 'react-3d-viewer'
render(){
return(
<div>
<OBJModel src="./a.obj" texPath=""/>
</div>
)
}
import {Tick,MTLModel} from 'react-3d-viewer'
render(){
return(
<div>
<MTLModel
enableZoom = {false}
position={{x:0,y:-100,z:0}}
rotation={this.state.rotation}
texPath="./src/lib/model/"
mtl="./src/lib/model/freedom.mtl"
src="./src/lib/model/freedom.obj"
/>
</div>
)
}
componentWillMount(){
this.tick.animate = false
}
componentDidMount(){
this.tick = Tick(()=>{
var {rotation} = this.state
rotation.y += 0.005
this.setState({rotation})
})
}
import {DAEModel,DirectionLight } from 'react-3d-viewer'
render(){
return(
<div>
<DAEModel
src={'./src/lib/model/Ruins_dae.dae'}
onLoad={()=>{
// ...
}}
>
<DirectionLight color={0xff00ff}/>
</DAEModel>
</div>
)
}
<script src="https://unpkg.com/react-3d-viewer@latest/dist/scripts/react-3d-viewer.js"></script>
<script src="https://unpkg.com/react@16.4.1/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16.4.1/umd/react-dom.production.min.js"></script>
<div id="example"></div>
<script >
// It's not recommended to use this way.
ReactDOM.render(
React.createElement('div',{ style: { width: 600, margin: '0px auto' } },
React.createElement(React3DViewer.JSONModel, {
src:'./src/lib/model/kapool.js'
})
)
,document.getElementById('example'));
</script>
To view a demo,click here.
| Property | Type | Default | Description |
|---|---|---|---|
| width | number | 500 | The width of container |
| height | number | 500 | The height of container |
| texPath | string | '' | Set the base path for the img file |
| onLoad | function | undefined | A function to be called after the loading is successfully completed |
| onProgress | function | undefined | A function to be called while the loading is in progress |
| enableKeys | boolen | true | Enable or disable the use of keyboard controls |
| enableRotate | boolen | true | Enable or disable horizontal and vertical rotation of the camera |
| enableZoom | boolen | true | Enable or disable zooming of the camera |
| enabled | boolen | true | Whether or not the controls are enabled |
| src | string | undefined | The path of the file |
| mtl | string | undefined | The path of the .mtl file |
| anitialias | boolen | true | Whether to perform antialiasing |
| position | object | {x:0,y:0,z:0} | Object's position |
| rotation | object | {x:0,y:0,z:0} | Object's rotation |
MIT
more like this
🎉🌟✨🎈年会抽奖程序,基于 Express + Three.js的 3D 球体抽奖程序,奖品🧧🎁,文字,图片,抽奖规则均可配置,😜抽奖人员信息Excel一键导入😍,抽奖结果Excel导出😎,给你的抽奖活动带来全新酷炫体验🚀🚀🚀
🎥🤟 8 minimalistic templates for tfjs mediapipe handpose and facemesh
Firefox and Chrome extensions to prevent Google from making links ugly.
A repository about starting from scratch for monorepo, fastify, Phaser, colyseus, and threejs.
search projects, people, and tags