VglCylinderGeometry
This is a component for generating cylinder geometries, corresponding THREE.CylinderGeometry.
Properties of VglGeometry are also available as mixin.
props
-
radius-topfloat (optional)default: 1Radius of the cylinder at the top.
-
radius-bottomfloat (optional)default: 1Radius of the cylinder at the bottom.
-
heightfloat (optional)default: 1Height of the cylinder.
-
radial-segmentsint (optional)default: 8Number of segmented faces around the circumference of the cylinder.
-
height-segmentsint (optional)default: 1Number of rows of faces along the height of the cylinder.
-
open-endedboolean (optional)A Boolean indicating whether the ends of the cylinder are open or capped.
-
theta-startfloat (optional)Start angle for first segment.
-
theta-lengthfloat (optional)default: [object Object]The central angle of the circular sector.
computed properties
-
instdependencies:
radiusTop,radiusBottom,height,radialSegments,heightSegments,openEnded,thetaStart,thetaLength
Example
<template>
<div>
<vgl-renderer
antialias
camera="camera"
scene="scene"
>
<vgl-scene name="scene">
<vgl-cylinder-geometry
name="cylinder"
:radius-top="radiusTop"
:radius-bottom="radiusBottom"
:height="height"
/>
<vgl-mesh-standard-material name="std" />
<vgl-mesh
geometry="cylinder"
material="std"
/>
<vgl-ambient-light color="#ffeecc" />
<vgl-directional-light position="0 1 2" />
</vgl-scene>
<vgl-perspective-camera
orbit-position="200 1 0.5"
name="camera"
/>
</vgl-renderer>
<aside class="control-panel">
<label>Top radius<input
v-model="radiusTop"
type="range"
></label>
<label>Bottom radius<input
v-model="radiusBottom"
type="range"
></label>
<label>Height<input
v-model="height"
type="range"
></label>
</aside>
</div>
</template>
<script>
export default {
data: () => ({
radiusTop: 25,
radiusBottom: 25,
height: 50,
}),
};
</script>