Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve vr haptics example #23307

Merged
merged 3 commits into from
Jan 26, 2022
Merged

Improve vr haptics example #23307

merged 3 commits into from
Jan 26, 2022

Conversation

zz85
Copy link
Contributor

@zz85 zz85 commented Jan 23, 2022

Description

  • make audio more pleasant
    a) changing frequency to a pentatonic
    b) changing oscillator from square to sine type
  • fix a bug so multiple boxes can simultaneously light up when
    more than 1 controllers is used

before
image

after
image

https://raw.githack.com/zz85/three.js/improve_haptics/examples/webxr_vr_haptics.html

- make audio more pleasant
  a) changing frequency to a pentatonic
  b) changing oscillator from square to sine type
- fix a bug so multiple boxes can simultaneously light up when
  more than 1 controllers is used
@mrdoob mrdoob added this to the r137 milestone Jan 24, 2022
@mrdoob
Copy link
Owner

mrdoob commented Jan 24, 2022

Hmm, it crashes on the Quest... The devtools shows this:

Screen Shot 2022-01-24 at 12 24 25 PM

@mrdoob mrdoob modified the milestones: r137, r138 Jan 25, 2022
@zz85
Copy link
Contributor Author

zz85 commented Jan 25, 2022

ahhh silly me, that's an off-by-one error - i had one less note in the music scale than the number of boxes.
now, there can be as many notes as there are boxes (if we increase them)

@mrdoob
Copy link
Owner

mrdoob commented Jan 26, 2022

I think one note is repeated but it's definitely better than before.

@mrdoob mrdoob merged commit c77a176 into mrdoob:dev Jan 26, 2022
@mrdoob
Copy link
Owner

mrdoob commented Jan 26, 2022

Thanks!

@mrdoob mrdoob modified the milestones: r138, r137 Jan 26, 2022
@mrdoob
Copy link
Owner

mrdoob commented Jan 26, 2022

Further improvement ideas: We should just just use https://tonejs.github.io/ here. It'll sound much better 🤓

@zz85
Copy link
Contributor Author

zz85 commented Jan 26, 2022

I think one note is repeated but it's definitely better than before.

Right, I shouldn't have include 12 (which is basically the same note as 0). 😅

Further improvement ideas: We should just just use https://tonejs.github.io/ here. It'll sound much better 🤓

I was just looking at that too... looks tone.js can do a lot if we are ok with pulling an extra dependency

@mrdoob
Copy link
Owner

mrdoob commented Jan 26, 2022

Right, I shouldn't have include 12 (which is basically the same note as 0). 😅

😁

I was just looking at that too... looks tone.js can do a lot if we are ok with pulling an extra dependency

Yeah, that's not a problem. We should definitely up our game sound-wise.

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

Successfully merging this pull request may close these issues.

2 participants