Skip to content

wind#3029

Merged
avaer merged 11 commits intomasterfrom
tcm-wind
May 27, 2022
Merged

wind#3029
avaer merged 11 commits intomasterfrom
tcm-wind

Conversation

@tcm390
Copy link
Contributor

@tcm390 tcm390 commented May 19, 2022

Add wind in the scn file. Sibling PR: webaverse/totum#114

Webaverse.-.Google.Chrome.2022-05-19.13-42-50.mp4

Just have 2 wind type now: directional and spherical (reference: https://docs.unity3d.com/Manual/class-WindZone.html)
And the other parameters are:
"direction"
"radius" (only active for spherical)
"position" (only active for spherical)
"windForce"
"noiseScale"
"windFrequency"

Issue:

  1. hair would pass through face if the windForce is too large
    image
  2. Some characters do not have springBones

@tcm390 tcm390 marked this pull request as draft May 19, 2022 20:27
@tcm390 tcm390 changed the title wind wind-WIP May 19, 2022
@avaer
Copy link
Contributor

avaer commented May 20, 2022

Looks great!

@avaer
Copy link
Contributor

avaer commented May 27, 2022

What do we need to ship this? (it's still marked as WIP)

@tcm390 tcm390 requested a review from avaer May 27, 2022 19:59
@tcm390 tcm390 marked this pull request as ready for review May 27, 2022 19:59
@tcm390 tcm390 changed the title wind-WIP wind May 27, 2022
@tcm390
Copy link
Contributor Author

tcm390 commented May 27, 2022

noiseScale 0.1

Webaverse.-.Google.Chrome.2022-05-27.16-06-14.mp4

noiseScale 0.5

Webaverse.-.Google.Chrome.2022-05-27.16-07-01.mp4

noiseScale 1

Webaverse.-.Google.Chrome.2022-05-27.16-10-16.mp4

const maxIdleVelocity = 0.01;
const maxEyeTargetTime = 2000;

const simplex = new SimplexNoise();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can move this winds code to a separate file to make the code cleaner. Avatars.js update function is already far too long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,4 +1,5 @@
import * as THREE from 'three';
import { SimplexNoise } from 'three/examples/jsm/math/SimplexNoise.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a different noise in procgen.js:

Simplex,

I don't care which one we use but other code uses this one so we should be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used noise from simplex-noise.js

const _applyWind = () => {
const winds = metaversefile.getWinds();
//console.log(winds)
const timeS = performance.now() / 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be read from a timestamp passed in from update().

In general we should not do performance.now() in our code so the timestamps for all apps are consistent, rather than slightly off.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used the timestamp from avatar.js

Copy link
Contributor

@avaer avaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of cleanups recommended, but the code looks good.

@tcm390
Copy link
Contributor Author

tcm390 commented May 27, 2022

And this is sibling PR: webaverse/totum#114

@avaer
Copy link
Contributor

avaer commented May 27, 2022

We should add an example scn file to the repo. It can be a copy of another scene, like the block in the original video.

@avaer avaer merged commit 30e87d6 into master May 27, 2022
lalalune pushed a commit to TheNexusCity/webaverse-app that referenced this pull request Jun 9, 2022
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.

3 participants