Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

Intitial Yaw #107

Closed
broux2 opened this issue Dec 22, 2016 · 13 comments
Closed

Intitial Yaw #107

broux2 opened this issue Dec 22, 2016 · 13 comments
Labels

Comments

@broux2
Copy link

broux2 commented Dec 22, 2016

I am trying to use defualt_yaw as described in vrview-web developers concepts. This has no effect on the initial yaw of my images. Possibly because the VRView initial image is a blank image and then I am loading a scene onVRViewReady. Can the yaw be set different for each scene?

@borismus
Copy link
Contributor

borismus commented Dec 26, 2016 via email

@broux2
Copy link
Author

broux2 commented Jan 4, 2017

I am just putting that attribute into my scenes. See the Living Room Example.

var scenes = { Livingroom: { image: 'images/LivingroomMobile.jpeg', default_yaw: 170, //preview: 'dolphins-preview.jpg', hotspots: { Kitchen: { pitch: 15, yaw: -178.91050685508486, radius: 0.05, distance: 2 }, Bedroom: { pitch: 10, yaw: -142, radius: 0.05, distance: 2 }, Bathroom: { pitch: 0, yaw: -122, radius: 0.05, distance: 2 }, Livingroom2: { pitch: 0, yaw: -80, radius: 0.05, distance: 2 } } }, Kitchen: { image: 'images/kitchenMobile.jpeg', //preview: 'whale-left-preview.jpg', hotspots: { Livingroom: { pitch: 15, yaw: 170, radius: 0.05, distance: 2.5 } } },

@Nagell
Copy link

Nagell commented Jan 7, 2017

Same problem here. It seems that the more of "yaw" is added, the lower "pitch" becomes. With 90 of "yaw", "pitch" reaches 0. Those shouldn't be connected but somehow they are.

I'm also using example with hotspots (dolphins, etc.). I've changed nothing more but \examples\hotspots\index.js

main: {
    image: 'main.jpg',
    preview: 'main-preview.jpg',
    hotspots: {
      whaleLeft: {
        pitch: 0,
        yaw: 80,
        radius: 0.05,
        distance: 1
      },
      whaleRight: {
        pitch: 40,
        yaw: 0,
        radius: 0.05,
        distance: 1
      },
      dolphins: {
        pitch: 40, //here's something wrong - it should be much higher
        yaw: 90,
        radius: 0.05,
        distance: 1
      }
    }
  }

@Nagell
Copy link

Nagell commented Jan 7, 2017

What's more hotspot just disappears (transparency is 100%) while "pitch" is more than 60

hotspots: {
      bedroom: {
        pitch: 59,
        yaw: 0,
        radius: 0.05,
        distance: 1
      },
      corridor: {
        pitch: 55,
        yaw: 0,
        radius: 0.05,
        distance: 1
      },
      main: {
        pitch: 50,
        yaw: 0,
        radius: 0.05,
        distance: 1
      }
}

@broux2
Copy link
Author

broux2 commented Jan 7, 2017

The dissapearing hitspot over 60 issue i fixed. I cant give you the exact info as i only have the code on my work computer but there are some lines that specify a fade of the hotspot based on pitch. I belive fade start is at 30 and end is at 60. I turned the end up to 90 to stop them from disapearing. I will probably adjust lower limit as well to stop all fading. I dont get why they did thst anyway.

@Nagell
Copy link

Nagell commented Jan 8, 2017

If you can send me your code it would be very helpful :)

@broux2
Copy link
Author

broux2 commented Jan 8, 2017

Look for this code in the hotspot-renderer.js.

// Constants for opacity.
var MAX_INNER_OPACITY = 0.8;
var MAX_OUTER_OPACITY = 0.5;
var FADE_START_ANGLE_DEG = 35;
var FADE_END_ANGLE_DEG = 60;
/**

I actually changed the sane lines in the compiled embed.js file.

@Nagell
Copy link

Nagell commented Jan 9, 2017

Look for this code in the hotspot-renderer.js.
...

Thanks for this :)

info for @borismus - there's still a problem with correlation between "yaw" and "pitch"

@lkieliger
Copy link

lkieliger commented Feb 13, 2017

Hey @Nagell , I was getting the same problem regarding "yaw" and "pitch". The problem turned out to be the order given to the Euler angle constructor (which is originally left by default as XYZ).

In the Hotspot add function, change this line:

quat.setFromEuler(new THREE.Euler(THREE.Math.degToRad(pitch), THREE.Math.degToRad(yaw), 0));

to

quat.setFromEuler(new THREE.Euler(THREE.Math.degToRad(pitch), THREE.Math.degToRad(yaw), 0, 'ZYX'));

@paulgailey
Copy link

i tried the value "default_yaw" as a parameter in e VRview embed and noted it was ineffective.

I since noticed the codelabs documentation refers instead to "start_yaw" and i found that did work.

Seems like the documentation maybe incorrect.

@georgedumontier
Copy link

I'm having the same problem with the pitch and yaw being connected. It makes positioning hotspots impossible. @lkieliger 's comment work for anybody? I'm about to try it.

@NPTPolynomial
Copy link

confirmed! @lkieliger 's comment worked. @georgedumontier.

Previously when yaw got larger than 140, pitch would go backwards. Setting 'ZYX', solved the problem.

screen shot 2017-05-12 at 4 56 04 pm

@georgedumontier
Copy link

@NPTPolynomial @lkieliger Wow! Thanks!

Idk what this did, but now I can adjust pitch and yaw independently of each other. Thank you so much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants