- Notifications
You must be signed in to change notification settings - Fork0
Plugin to add lens flares to a Photo Sphere Viewer (Library: PhotoSphereViewer) by mistic100
License
Elius94/psv-lens-flare-plugin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Plugin to add lens flares to a Photo Sphere Viewer (Library:PhotoSphereViewer) bymistic100
npm install photo-sphere-viewer-lensflare-plugin
yarn add photo-sphere-viewer-lensflare-plugin
<scriptsrc="https://cdn.jsdelivr.net/npm/photo-sphere-viewer-lensflare-plugin/dist/index.min.js"></script>
import{LensflarePlugin}from'photo-sphere-viewer-lensflare-plugin';
constviewer=newPhotoSphereViewer.Viewer({container:document.querySelector('#viewer'),panorama:'pano.jpg',plugins:[[LensflarePlugin,{lensflares:[{id:'sun',position:{yaw:'145deg',pitch:'2deg'},type:0,}]}]]});
Option | Type | Default | Description |
---|---|---|---|
lensflares | Array | [] | Array of lens flares |
Option | Type | Default | Description |
---|---|---|---|
id | String | '' | ID of the lens flare |
position | Object | { yaw: '0deg', pitch: '0deg' } | Position of the lens flare |
type | Number | 0 | Type of the lens flare (available: 0) |
color | HSL | { h: 0.08, s: 0.2, l: 0.5 } | Color of the lens flare |
To call methods you need to get the plugin instance.
constlensflaresPlugin=viewer.getPlugin(LensflarePlugin);
and then you can call the methods.
Toggle all lens flares.
lensflaresPlugin.toggleAllLensflares();
Show all lens flares.
lensflaresPlugin.showAllLensflares();
Hide all lens flares.
lensflaresPlugin.hideAllLensflares();
Get the number of lens flares.
constnb=lensflaresPlugin.getNbLensflares();
Get all the lens flares.
constlensflares:LensflareObject[]=lensflaresPlugin.getLensflares();
Get a lens flare.
constlensflare:LensflareObject=lensflaresPlugin.getLensflare('sun');
Add a lens flare.
lensflaresPlugin.addLensflare({id:'sun',position:{yaw:'145deg',pitch:'2deg'},type:0,});
Update a lens flare.
lensflaresPlugin.updateLensflare({id:'sun',position:{yaw:'145deg',pitch:'2deg'},type:0,});
Remove a lens flare.
lensflaresPlugin.removeLensflare('sun');
Remove multiple lens flares.
lensflaresPlugin.removeLensflares(['sun','moon']);
Clear all lens flares and add new ones.
lensflaresPlugin.setLensflares([{id:'sun',position:{yaw:'145deg',pitch:'2deg'},type:0,},{id:'moon',position:{yaw:'30.6deg',pitch:'41.2deg'},type:0,}]);
Clear all lens flares.
lensflaresPlugin.clearLensflares();
npm runtest
constviewer=newPhotoSphereViewer.Viewer({container:document.querySelector('#viewer'),panorama:'pano.jpg',defaultYaw:20.75,defaultPitch:0.17,plugins:[[PhotoSphereViewerLensflarePlugin,{lensflares:[{id:'sun',position:{yaw:'145deg',pitch:'2deg'},},{id:'moon',position:{yaw:'30.6deg',pitch:'41.2deg'},color:{h:0.6,s:0.5,l:0.2},}]}]]});
About
Plugin to add lens flares to a Photo Sphere Viewer (Library: PhotoSphereViewer) by mistic100
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.