flimshaw / flimshaw/Valiant360

Feature: Changed Origin Offset

Open
#37 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
780
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Currently in the code in the mouseMove function there are some harcoded values that affect which point is considered the "center" of the video. While these are simple enough to change in the source file, this should probably be a setup option.

``` javascript
this._lon = ( x / $(this.element).find('canvas').width() ) * 430 - 225;
this._lat = ( y / $(this.element).find('canvas').height() ) * -180 + 90;
```

to

``` javascript
this._lon = ( x / $(this.element).find('canvas').width() ) * 430 - this.options.viewOffsetX;
this._lat = ( y / $(this.element).find('canvas').height() ) * -180 + this.options.viewOffsetY;
```

``` javascript
$('.valiant').Valiant360({
viewOffsetX: 225, // offset for camera angle Lon
viewOffsetY: 90, // offset for camera angle Lat
});
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in the mouseMove function where _lon and _lat use the hardcoded 225 and 90 offsets, then read the Valiant360 setup options shown in the issue. Add viewOffsetX and viewOffsetY as setup options and verify that configuring them changes the camera-angle offsets instead of using the hardcoded values.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.