-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/postprocessing-per-scene
# Conflicts: # src/store/rootListener.js
- Loading branch information
Showing
36 changed files
with
614 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"nodes":{"sceneCrossfader":{"id":"sceneCrossfader","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Scene Crossfader","type":"param","valueType":"float"},"viewerMode":{"id":"viewerMode","value":"mix","inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Viewer Mode","valueType":"enum","options":[{"value":"mix","label":"Mix"},{"value":"A","label":"A"},{"value":"B","label":"B"}]},"sketchOrganization":{"id":"sketchOrganization","value":"category","inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Sketch Organization","valueType":"enum","options":[{"value":"folder","label":"Folder"},{"value":"category","label":"Category"},{"value":"author","label":"Author"}]},"audioLevelsFalloff":{"id":"audioLevelsFalloff","value":1,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Levels Falloff","type":"param","valueType":"float"},"audioLevelsPower":{"id":"audioLevelsPower","value":0.25,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Levels Power","type":"param","min":0.5,"max":3,"valueType":"float"},"audioLevelsSmoothing":{"id":"audioLevelsSmoothing","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Levels Smoothing","type":"param","valueType":"float"},"audioNormalizeLevels":{"id":"audioNormalizeLevels","value":0.5,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Normalize Levels","type":"param","valueType":"float"},"audioNormalizeRangeFalloff":{"id":"audioNormalizeRangeFalloff","value":0.01,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Normalized Range Falloff","type":"param","valueType":"float"},"8t986ba":{"id":"8t986ba","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"type":"linkableAction","action":{"type":"R_SCENE_SELECT_CHANNEL","payload":{"id":"clben3e","channel":"A"}},"title":"Add to A"},"lbs077c":{"id":"lbs077c","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"type":"linkableAction","action":{"type":"R_SCENE_SELECT_CHANNEL","payload":{"id":"clben3e","channel":"B"}},"title":"Add to B"},"sfniesu":{"id":"sfniesu","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"type":"linkableAction","action":{"type":"U_SCENE_SELECT_CHANNEL","payload":{"id":"clben3e","type":"active"}},"title":"Add to Active"},"jvu3a19":{"id":"jvu3a19","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"type":"linkableAction","action":{"type":"U_SCENE_SELECT_CHANNEL","payload":{"id":"clben3e","type":"opposite"}},"title":"Add to Opposite"},"jmv70qa":{"id":"jmv70qa","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"type":"linkableAction","action":{"type":"SCENE_CLEAR_CHANNEL","payload":{"id":"clben3e"}},"title":"Clear"},"hfder0b":{"id":"hfder0b","value":0.5,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"posX","valueType":"float","type":"param","key":"posX","hidden":false,"min":-10,"max":10,"defaultMin":-10,"defaultMax":10},"rso6m4s":{"id":"rso6m4s","value":0.5,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"posY","valueType":"float","type":"param","key":"posY","hidden":false,"min":-10,"max":10,"defaultMin":-10,"defaultMax":10},"a1go2hk":{"id":"a1go2hk","value":0.5,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"posZ","valueType":"float","type":"param","key":"posZ","hidden":false,"min":-20,"max":0,"defaultMin":-20,"defaultMax":0},"2xqo3rj":{"id":"2xqo3rj","value":0.47122812942102554,"inputLinkIds":["io217ye"],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"rotX","valueType":"float","type":"param","key":"rotX","hidden":false,"min":-3.1415,"max":3.1415,"defaultMin":-3.1415,"defaultMax":3.1415,"openedLinkId":"io217ye","activeInputLinkId":"io217ye"},"3481g1f":{"id":"3481g1f","value":0.5226995249869767,"inputLinkIds":["cvfgudh"],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"rotY","valueType":"float","type":"param","key":"rotY","hidden":false,"min":-3.1415,"max":3.1415,"defaultMin":-3.1415,"defaultMax":3.1415,"openedLinkId":"cvfgudh","activeInputLinkId":"cvfgudh"},"btkw827":{"id":"btkw827","value":0.5,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"rotZ","valueType":"float","type":"param","key":"rotZ","hidden":false,"min":-3.1415,"max":3.1415,"defaultMin":-3.1415,"defaultMax":3.1415},"pxct299":{"id":"pxct299","value":0.6,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"colorHue","valueType":"float","type":"param","key":"colorHue","hidden":false,"min":0,"max":1,"defaultMin":0,"defaultMax":1},"4g2pdov":{"id":"4g2pdov","value":0.5,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"colorSat","valueType":"float","type":"param","key":"colorSat","hidden":false,"min":0,"max":1,"defaultMin":0,"defaultMax":1},"45gll4y":{"id":"45gll4y","value":0.5,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"colorLight","valueType":"float","type":"param","key":"colorLight","hidden":false,"min":0,"max":1,"defaultMin":0,"defaultMax":1},"gtty2ek":{"id":"gtty2ek","value":1,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"alpha","valueType":"float","type":"param","key":"alpha","hidden":false,"min":0,"max":1,"defaultMin":0,"defaultMax":1},"kn34ift":{"id":"kn34ift","value":0.8353658536585367,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"scale","valueType":"float","type":"param","key":"scale","hidden":false,"min":0.00001,"max":10,"defaultMin":0.00001,"defaultMax":10},"fy0ec77":{"id":"fy0ec77","value":0.09475416182733261,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"thickness","valueType":"float","type":"param","key":"thickness","hidden":false,"min":0.0001,"max":1,"defaultMin":0.0001,"defaultMax":1},"6632fs9":{"id":"6632fs9","value":0.23809523809523825,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"bevelThickness","valueType":"float","type":"param","key":"bevelThickness","hidden":false,"min":0,"max":0.1,"defaultMin":0,"defaultMax":0.1},"qsimi6d":{"id":"qsimi6d","value":0.4206349206349207,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"bevelSize","valueType":"float","type":"param","key":"bevelSize","hidden":false,"min":0,"max":0.1,"defaultMin":0,"defaultMax":0.1},"sjfgmcw":{"id":"sjfgmcw","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"bevelSegments","valueType":"float","type":"param","key":"bevelSegments","hidden":false,"min":1,"max":4,"defaultMin":1,"defaultMax":4},"lecmd84":{"id":"lecmd84","value":":)","inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"sketchId":"ilsoob4","title":"text","valueType":"string","type":"param","key":"text","hidden":false},"j9k68xi":{"id":"j9k68xi","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"parentNodeId":"io217ye","sketchId":"ilsoob4","key":"threshold","title":"Threshold","passToNext":false,"subNode":true},"a5isgqd":{"id":"a5isgqd","value":0.47028985507246374,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"parentNodeId":"io217ye","sketchId":"ilsoob4","key":"range","title":"Lower Range","passToNext":true,"subNode":true},"glm84k3":{"id":"glm84k3","value":0.5253623188405797,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"parentNodeId":"io217ye","sketchId":"ilsoob4","key":"range","title":"Upper Range","passToNext":false,"subNode":true},"cg342np":{"id":"cg342np","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"parentNodeId":"io217ye","sketchId":"ilsoob4","key":"increment","title":"Increment","passToNext":false,"valueType":"enum","options":[{"value":0,"label":"Off"},{"value":1,"label":"Increment"},{"value":2,"label":"Decrement"}],"subNode":true},"ebh4xjd":{"id":"ebh4xjd","value":"sine","inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Shape","key":"shape","valueType":"enum","subNode":true,"options":[{"value":"sine","label":"Sine"},{"value":"square","label":"Square"},{"value":"sawtooth","label":"Sawtooth"},{"value":"rSawtooth","label":"Revese Sawtooth"},{"value":"triangle","label":"Triangle"},{"value":"noise","label":"Noise"}],"sketchId":"ilsoob4","parentNodeId":"io217ye"},"q9eqs8s":{"id":"q9eqs8s","value":0.125,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Rate","key":"rate","valueType":"enum","subNode":true,"options":[{"value":32,"label":"32"},{"value":16,"label":"16"},{"value":8,"label":"8"},{"value":4,"label":"4"},{"value":2,"label":"2"},{"value":1,"label":"1"},{"value":0.5,"label":"1/2"},{"value":0.25,"label":"1/4"},{"value":0.125,"label":"1/8"},{"value":0.0625,"label":"1/16"},{"value":0.03125,"label":"1/32"}],"sketchId":"ilsoob4","parentNodeId":"io217ye"},"p3bsiyw":{"id":"p3bsiyw","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Phase","key":"phase","subNode":true,"sketchId":"ilsoob4","parentNodeId":"io217ye"},"frqgjjf":{"id":"frqgjjf","value":-1,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Seed","key":"seed","valueType":"enum","subNode":true,"options":[{"value":-1,"label":"auto"},{"value":0,"label":"0"},{"value":1,"label":"1"},{"value":2,"label":"2"},{"value":3,"label":"3"},{"value":4,"label":"4"},{"value":5,"label":"5"},{"value":6,"label":"6"},{"value":7,"label":"7"},{"value":8,"label":"8"},{"value":9,"label":"9"},{"value":10,"label":"10"},{"value":11,"label":"11"},{"value":12,"label":"12"},{"value":13,"label":"13"},{"value":14,"label":"14"},{"value":15,"label":"15"},{"value":16,"label":"16"},{"value":17,"label":"17"},{"value":18,"label":"18"},{"value":19,"label":"19"},{"value":20,"label":"20"},{"value":21,"label":"21"},{"value":22,"label":"22"},{"value":23,"label":"23"},{"value":24,"label":"24"}],"sketchId":"ilsoob4","parentNodeId":"io217ye"},"9uwj9j3":{"id":"9uwj9j3","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"type":"linkableAction","title":"Toggle Activate","action":{"type":"NODE_ACTIVE_INPUT_LINK_TOGGLE","payload":{"nodeId":"2xqo3rj","linkId":"io217ye"}},"sketchId":"ilsoob4","parentNodeId":"io217ye"},"io217ye":{"id":"io217ye","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"lfo","type":"inputLink","input":{"id":"lfo","type":"lfo"},"nodeId":"2xqo3rj","sketchId":"ilsoob4","parentNodeId":"2xqo3rj","nodeType":"param","modifierIds":["j9k68xi","a5isgqd","glm84k3","cg342np"],"optionIds":["ebh4xjd","q9eqs8s","p3bsiyw","frqgjjf"],"linkableActions":{"toggleActivate":"9uwj9j3"},"linkType":"node"},"dluj7y7":{"id":"dluj7y7","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"parentNodeId":"cvfgudh","sketchId":"ilsoob4","key":"threshold","title":"Threshold","passToNext":false,"subNode":true},"gijdhgl":{"id":"gijdhgl","value":0.45,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"parentNodeId":"cvfgudh","sketchId":"ilsoob4","key":"range","title":"Lower Range","passToNext":true,"subNode":true},"3l719ya":{"id":"3l719ya","value":0.5499999999999999,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"parentNodeId":"cvfgudh","sketchId":"ilsoob4","key":"range","title":"Upper Range","passToNext":false,"subNode":true},"oonmkes":{"id":"oonmkes","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"parentNodeId":"cvfgudh","sketchId":"ilsoob4","key":"increment","title":"Increment","passToNext":false,"valueType":"enum","options":[{"value":0,"label":"Off"},{"value":1,"label":"Increment"},{"value":2,"label":"Decrement"}],"subNode":true},"x4exlbp":{"id":"x4exlbp","value":"sine","inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Shape","key":"shape","valueType":"enum","subNode":true,"options":[{"value":"sine","label":"Sine"},{"value":"square","label":"Square"},{"value":"sawtooth","label":"Sawtooth"},{"value":"rSawtooth","label":"Revese Sawtooth"},{"value":"triangle","label":"Triangle"},{"value":"noise","label":"Noise"}],"sketchId":"ilsoob4","parentNodeId":"cvfgudh"},"w96cmpy":{"id":"w96cmpy","value":0.125,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Rate","key":"rate","valueType":"enum","subNode":true,"options":[{"value":32,"label":"32"},{"value":16,"label":"16"},{"value":8,"label":"8"},{"value":4,"label":"4"},{"value":2,"label":"2"},{"value":1,"label":"1"},{"value":0.5,"label":"1/2"},{"value":0.25,"label":"1/4"},{"value":0.125,"label":"1/8"},{"value":0.0625,"label":"1/16"},{"value":0.03125,"label":"1/32"}],"sketchId":"ilsoob4","parentNodeId":"cvfgudh"},"c7iwm7o":{"id":"c7iwm7o","value":0.2833333333333334,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Phase","key":"phase","subNode":true,"sketchId":"ilsoob4","parentNodeId":"cvfgudh"},"or2tyfg":{"id":"or2tyfg","value":-1,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"Seed","key":"seed","valueType":"enum","subNode":true,"options":[{"value":-1,"label":"auto"},{"value":0,"label":"0"},{"value":1,"label":"1"},{"value":2,"label":"2"},{"value":3,"label":"3"},{"value":4,"label":"4"},{"value":5,"label":"5"},{"value":6,"label":"6"},{"value":7,"label":"7"},{"value":8,"label":"8"},{"value":9,"label":"9"},{"value":10,"label":"10"},{"value":11,"label":"11"},{"value":12,"label":"12"},{"value":13,"label":"13"},{"value":14,"label":"14"},{"value":15,"label":"15"},{"value":16,"label":"16"},{"value":17,"label":"17"},{"value":18,"label":"18"},{"value":19,"label":"19"},{"value":20,"label":"20"},{"value":21,"label":"21"},{"value":22,"label":"22"},{"value":23,"label":"23"},{"value":24,"label":"24"}],"sketchId":"ilsoob4","parentNodeId":"cvfgudh"},"1p1g16c":{"id":"1p1g16c","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"type":"linkableAction","title":"Toggle Activate","action":{"type":"NODE_ACTIVE_INPUT_LINK_TOGGLE","payload":{"nodeId":"3481g1f","linkId":"cvfgudh"}},"sketchId":"ilsoob4","parentNodeId":"cvfgudh"},"cvfgudh":{"id":"cvfgudh","value":0,"inputLinkIds":[],"shotCount":0,"connectedMacroIds":[],"title":"lfo","type":"inputLink","input":{"id":"lfo","type":"lfo"},"nodeId":"3481g1f","sketchId":"ilsoob4","parentNodeId":"3481g1f","nodeType":"param","modifierIds":["dluj7y7","gijdhgl","3l719ya","oonmkes"],"optionIds":["x4exlbp","w96cmpy","c7iwm7o","or2tyfg"],"linkableActions":{"toggleActivate":"1p1g16c"},"linkType":"node"}},"scenes":{"items":{"clben3e":{"id":"clben3e","title":"New Scene","selectedSketchId":"ilsoob4","sketchIds":["ilsoob4"],"linkableActionIds":{"addToA":"8t986ba","addToB":"lbs077c","addToActive":"sfniesu","addToOpposite":"jvu3a19","clear":"jmv70qa"}}},"sceneIds":["clben3e"],"currentSceneId":"clben3e","channels":{"A":"clben3e","B":false}},"sketches":{"ilsoob4":{"title":"textBasic","moduleId":"textBasic","paramIds":["hfder0b","rso6m4s","a1go2hk","2xqo3rj","3481g1f","btkw827","pxct299","4g2pdov","45gll4y","gtty2ek","kn34ift","fy0ec77","6632fs9","qsimi6d","sjfgmcw","lecmd84"],"shotIds":[]}},"project":{"filePath":"/Users/cale.bradbury/git/hedron/example-projects/text/project.json","sketchesPath":"/Users/cale.bradbury/git/hedron/example-projects/text","errors":[],"errorPopup":false},"inputs":{"audio":{"value":[0.055862517338061586,0,0,0],"assignedLinkIds":[]},"lfo":{"value":86.33333333333333,"assignedLinkIds":["io217ye","cvfgudh"]}},"inputLinks":{"nodeIds":[null]},"midi":{"learning":false,"devices":{},"connectedDeviceIds":[]},"macros":{"learningId":false,"nodeIds":[]},"ui":{"panelWidths":{"left":34.57142857142857},"isEditing":false,"openedNode":false,"auxOpen":["uqsrn8x","spknf5b","22lvex7","fy0ec77"],"addSketchOpen":{}},"router":{"location":{"pathname":"/scenes/view","search":"","hash":"","key":"dt1whu"},"action":"PUSH"},"settings":{"clockGenerated":true,"clockBpm":120,"aspectW":16,"aspectH":9,"antialias":false,"throttledFPS":60,"watchSketchesDir":true},"form":{}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
module.exports = { | ||
defaultTitle: 'Text Basic', | ||
params: [ | ||
{ | ||
key: 'posX', | ||
defaultValue: 0.5, | ||
defaultMin: -10, | ||
defaultMax: 10, | ||
}, | ||
{ | ||
key: 'posY', | ||
defaultValue: 0.5, | ||
defaultMin: -10, | ||
defaultMax: 10, | ||
}, | ||
{ | ||
key: 'posZ', | ||
defaultValue: 0.5, | ||
defaultMin: -20, | ||
defaultMax: 0, | ||
}, | ||
|
||
{ | ||
key: 'rotX', | ||
defaultValue: 0.5, | ||
defaultMin: -3.1415, | ||
defaultMax: 3.1415, | ||
}, | ||
{ | ||
key: 'rotY', | ||
defaultValue: 0.5, | ||
defaultMin: -3.1415, | ||
defaultMax: 3.1415, | ||
}, | ||
{ | ||
key: 'rotZ', | ||
defaultValue: 0.5, | ||
defaultMin: -3.1415, | ||
defaultMax: 3.1415, | ||
}, | ||
{ | ||
key: 'colorHue', | ||
defaultValue: 0.6, | ||
}, | ||
{ | ||
key: 'colorSat', | ||
defaultValue: 0.5, | ||
}, | ||
{ | ||
key: 'colorLight', | ||
defaultValue: 0.5, | ||
}, | ||
{ | ||
key: 'alpha', | ||
defaultValue: 1, | ||
}, | ||
{ | ||
key: 'scale', | ||
defaultValue: 0.5, | ||
defaultMin: 0.00001, | ||
defaultMax: 10, | ||
}, | ||
{ | ||
key: 'thickness', | ||
defaultValue: 0.4, | ||
defaultMin: 0.0001, | ||
defaultMax: 1, | ||
}, | ||
{ | ||
key: 'text', | ||
defaultValue: ':)', | ||
valueType: 'string', | ||
}, | ||
], | ||
} |
1 change: 1 addition & 0 deletions
1
example-projects/text/textBasic/font/droid_sans_regular.typeface.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const { THREE } = window.HEDRON.dependencies | ||
const fontJson = require('./font/droid_sans_regular.typeface.json') | ||
|
||
class TextBasic { | ||
constructor ({ params }) { | ||
this.root = new THREE.Group() | ||
this.group = new THREE.Group() | ||
this.root.add(this.group) | ||
|
||
this.text = params.text | ||
|
||
this.font = new THREE.Font(fontJson) | ||
this.geometry = this.getGeometry(this.text) | ||
|
||
this.material = new THREE.MeshBasicMaterial({ | ||
color: new THREE.Color(), | ||
transparent: true, | ||
opacity: 0.7, | ||
}) | ||
|
||
this.mesh = new THREE.Mesh(this.geometry, this.material) | ||
this.group.add(this.mesh) | ||
} | ||
|
||
setText (text) { | ||
this.geometry = this.getGeometry(text) | ||
this.mesh.geometry = this.geometry | ||
} | ||
|
||
getGeometry (text) { | ||
this.text = text | ||
let a = text.split('\\n') | ||
let geometry = new THREE.Geometry() | ||
for (let i = 0; i < a.length; i++) { | ||
let geo = new THREE.TextGeometry(a[i], { | ||
size: 1, | ||
height: 1, | ||
font: this.font, | ||
style: 'normal', | ||
weight: 'normal', | ||
}) | ||
geo.center() | ||
geometry.merge(geo, new THREE.Matrix4().makeTranslation(0, -i * 1.2, 0)) | ||
} | ||
geometry.center() | ||
return geometry | ||
} | ||
|
||
update ({ params }) { | ||
if (this.text !== params.text) { | ||
this.setText(params.text) | ||
} | ||
|
||
this.material.opacity = params.alpha | ||
this.material.color.setHSL(params.colorHue, params.colorSat, params.colorLight) | ||
this.group.scale.set(params.scale, params.scale, params.scale * params.thickness) | ||
this.group.rotation.set(params.rotX, params.rotY, params.rotZ) | ||
this.group.position.set(params.posX, params.posY, params.posZ) | ||
} | ||
} | ||
|
||
module.exports = TextBasic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.