# <vgl-polar-grid-helper>

A basic object representation.

# Example Usage

<template>
  <div>
    <vgl-renderer antialias>
      <template #scene>
        <vgl-scene>
          <vgl-polar-grid-helper
            :radius="radius"
            :radials="radials"
            :circles="circles"
            :divisions="divisions"
            :color1="color1"
            :color2="color2"
          />
        </vgl-scene>
      </template>
      <template #camera>
        <vgl-perspective-camera
          position="spherical"
          :position-radius="15"
          :position-phi="1"
          :position-theta="0.5"
          rotation="lookAt"
          :look-at-y="-0.5"
        />
      </template>
    </vgl-renderer>

    <aside class="control-panel">
      <section>
        <h3>Grids</h3>
        <label>Radius<input
          v-model.number="radius"
          type="range"
          max="10"
          step="0.1"
        ></label>
        <label>Radials<input
          v-model.number="radials"
          type="range"
        ></label>
        <label>Circles<input
          v-model.number="circles"
          type="range"
        ></label>
        <label>Divisions<input
          v-model.number="divisions"
          type="range"
          min="3"
        ></label>
      </section>
      <section>
        <h3>Color 1</h3>
        <label>R<input
          v-model="r1"
          type="range"
          max="255"
        ></label>
        <label>G<input
          v-model="g1"
          type="range"
          max="255"
        ></label>
        <label>B<input
          v-model="b1"
          type="range"
          max="255"
        ></label>
      </section>
      <section>
        <h3>Color 2</h3>
        <label>R<input
          v-model="r2"
          type="range"
          max="255"
        ></label>
        <label>G<input
          v-model="g2"
          type="range"
          max="255"
        ></label>
        <label>B<input
          v-model="b2"
          type="range"
          max="255"
        ></label>
      </section>
    </aside>
  </div>
</template>

<script>
import * as components from 'vue-gl';

export default {
  components,
  data: () => ({
    radius: 5,
    radials: 16,
    circles: 8,
    divisions: 64,
    r1: '255',
    g1: '0',
    b1: '0',
    r2: '255',
    g2: '255',
    b2: '255',
  }),
  computed: {
    color1() { return `rgb(${this.r1}, ${this.g1}, ${this.b1})`; },
    color2() { return `rgb(${this.r2}, ${this.g2}, ${this.b2})`; },
  },
};
</script>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

# Props

  • position : 'rectangular' | 'spherical'
    The coodinate system to determine the object position.
    Defaults to [object Object]
  • positionX : number
    The x coordinate of the object's local position.
    Defaults to [object Object]
  • positionY : number
    The y coordinate of the object's local position.
    Defaults to [object Object]
  • positionZ : number
    The z coordinate of the object's local position.
    Defaults to [object Object]
  • positionRadius : number
    The Euclidian distance from the origin to the object's local position.
    Defaults to [object Object]
  • positionPhi : number
    The polar angle from y axis to the object's local position.
    Defaults to [object Object]
  • positionTheta : number
    The equator angle around y axis to the object's local position.
    Defaults to [object Object]
  • rotation : 'euler' | 'quaternion' | 'lookAt'
    The rotation representing method.
    Defaults to [object Object]
  • rotationX : number
    The x coordinate of the object's local rotation.
    Defaults to [object Object]
  • rotationY : number
    The y coordinate of the object's local rotation.
    Defaults to [object Object]
  • rotationZ : number
    The z coordinate of the object's local rotation.
    Defaults to [object Object]
  • rotationW : number
    The w coordinate of the object's local rotation.
    Defaults to [object Object]
  • rotationOrder : string
    The rotation order of the object's local rotation.
    Defaults to [object Object]
  • lookAtX : number
    The global x coodinate of a point the object to face.
    Defaults to [object Object]
  • lookAtY : number
    The global y coodinate of a point the object to face.
    Defaults to [object Object]
  • lookAtZ : number
    The global z coodinate of a point the object to face.
    Defaults to [object Object]
  • scaleX : number
    The x coordinate of the object's local scale.
    Defaults to [object Object]
  • scaleY : number
    The y coordinate of the object's local scale.
    Defaults to [object Object]
  • scaleZ : number
    The z coordinate of the object's local scale.
    Defaults to [object Object]
  • castShadow : boolean
    Whether the object gets rendered into the shadow map.
  • receiveShadow : boolean
    Whether the material receives shadows.
  • name : string
    An arbitrary name of the instance.
    Defaults to [object Object]
  • hidden : boolean
    The object visibility.
  • radius : number
    The radius of the grid.
    Defaults to [object Object]
  • radials : number
    The number of radial lines.
    Defaults to [object Object]
  • circles : number
    The number of circle lines.
    Defaults to [object Object]
  • divisions : number
    The number of line segments for each circle.
    Defaults to [object Object]
  • color1 : string|number
    The first line color.
    Defaults to [object Object]
  • color2 : string|number
    The second line color.
    Defaults to [object Object]

# Slots

  • default
    Objects defined in the slot will be handled as decsendants.