Comments (2)
Use rotation
or rotation-quaternion
prop on the VglObject3d
component.
Components in the Object group such as VglLine
, VglMesh
, VglPoints
... are based on VglObject3d
. So that we can pass props which belongs to VglObject3d
to them.
Here is an example:
<vgl-renderer camera="camera" scene="scene">
<vgl-scene name="scene">
<vgl-cylinder-geometry name="cylinder" radius-top="25" radius-bottom="25" height="50"></vgl-cylinder-geometry>
<vgl-mesh-basic-material name="material"></vgl-mesh-basic-material>
<!-- rotation prop below results the mesh to be rotated -->
<vgl-mesh geometry="cylinder" material="material" rotation="0.12 0.23 0.34 XYZ"></vgl-mesh>
</vgl-scene>
<vgl-perspective-camera orbit-position="200 1 0.5" name="camera"></vgl-perspective-camera>
</vgl-renderer>
from vue-gl.
Since version 1.x, rotating object is achieved by setting rotation mode and corresponding values as props. At v1.0.0, following rotating methods are available.
Defining rotation by Euler
Set rotation
prop to 'euler' and pass coordinates and axes order to rotation-
prefixed props.
<vgl-mesh rotation="euler" :rotation-x="0.1" :rotation-y="0.2" :rotation-z="0.3" :rotation-order="XYZ" />
Defining rotation by Quaternion
Set rotation
prop to 'quaternion' and pass coordinates to rotation-
prefixed props.
<vgl-mesh rotation="quaternion" :rotation-x="0.1" :rotation-y="0.2" :rotation-z="0.3" :rotation-w="0.4" />
Defining rotation that object face to specified position
Set rotation
prop to 'lookAt' and pass coordinates of the position that the object should face to to look-at-
prefixed props.
<vgl-mesh rotation="lookAt" :look-at-x="1.2" :look-at-y="3.4" :look-at-z="5.6" />
from vue-gl.
Related Issues (20)
- VueGL is not defined HOT 1
- iFrame created with vgl-renderer HOT 6
- TypeError: h is not a function HOT 1
- Video texture support HOT 1
- [Question] Types not found in v1.0? HOT 2
- Feature Request : WebXR support (add webxr related features and tooling)
- Vue 3 support HOT 1
- VglShape path prop improvement HOT 1
- [Question] How can use the CanvasTexture? HOT 1
- Material Array not updating HOT 2
- The raw shader material component
- Unable to use VglObjLoader : "Unknown custom element: <vgl-obj-loader>" HOT 3
- How to use VglObjLoader HOT 4
- Cannot run dev build (rollup problem?) HOT 1
- Using inside a fluid container HOT 4
- SphericalReflectionMapping error HOT 3
- Transparent Sphere
- VueGL + Nuxt: Cannot read property 'trim' of undefined HOT 1
- Is EffectComposer supported? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-gl.