Skip to content

Conversation

paulmasson
Copy link
Contributor

This is a math-based WebVR example. The Lorenz attractor is fairly easy to code, and while it's fun enough in a browser it's more interesting when you're right inside the evolution:

https://rawgit.com/paulmasson/three.js/webvr/examples/webvr_lorenz_attractor.html

The evolution will repeat and repeat, vanishing and restarting every time the color is red.

This is an example of the possibilities of WebVR for mathematical education and art.

var current = 1;
var shown = 10000;

var beta = 8/3;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: 8 / 3

@cvan
Copy link
Contributor

cvan commented May 27, 2018

this is really beautiful. nice work! 🌃

@paulmasson
Copy link
Contributor Author

@mrdoob no interest in this example?

@mrdoob
Copy link
Owner

mrdoob commented Jun 12, 2018

Wouldn't it be better the lorenz attractor in front of the user?

@paulmasson
Copy link
Contributor Author

@mrdoob not quite understanding: on my Oculus Go, it is right in front of me. Where is it for you, using what equipment?

@mrdoob
Copy link
Owner

mrdoob commented Jun 12, 2018

Oh! Sorry... I didn't get to try it in VR. By checking the example on my desktop I had the impression the user was inside the object.

@mrdoob mrdoob added this to the r94 milestone Jun 12, 2018
@mrdoob
Copy link
Owner

mrdoob commented Jun 12, 2018

Okay, got to test it in VR.

It feels like the attractor is mapped into a sphere and we're inside of it...? The lorenz attractor doesn't seem to have depth... Is that intentional?

@paulmasson
Copy link
Contributor Author

The viewer is close enough to the attractor to have to look around to see it all, but not inside it. I haven't done any particular mapping and there is no intention to flatten it. I personally perceive depth in the attractor. The black background makes it more dramatic, but maybe that flattens the object for you.

@mrdoob
Copy link
Owner

mrdoob commented Jun 14, 2018

Trying to understand the code...

What is the size of the object? I can see the camera near/far goes from 1 decimeter to 1 kilometer...

@paulmasson
Copy link
Contributor Author

The attractor is generally about 100 units across, but because it starts are random positions the outer loops can potentially be larger so I just threw in a bigger number. I tend to use 1000 by default, partly because it's in the documentation demo. Is there a significant performance hit if there's nothing there to render?

@mrdoob
Copy link
Owner

mrdoob commented Jun 14, 2018

That's why I don't sense any depth. You're rendering an object 100 meters away that can be up to a 1 kilometer in size. Depth is not as obvious when going from 100 meters to 1 kilometer.

Do you mind making the object smaller? Place it 1 meter in front of the user and reduce its size until it's all visible. In VR it will become much more physical. Not only that but in positional VR you'll be able to walk around it 😊

@paulmasson
Copy link
Contributor Author

Requested changes done. I didn't want to make the attractor too small so as not to lose too much detail. The perceived depth is much improved. Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2018

Awesome! Much better.
Walking around it feels great also! 😄

@mrdoob mrdoob merged commit 610d085 into mrdoob:dev Jun 18, 2018
@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2018

Thanks!

@mrdoob mrdoob changed the title Proposed WebVR example Added Lorenz Attractor WebVR example Jun 25, 2018
@mrdoob
Copy link
Owner

mrdoob commented Jun 25, 2018

Improved the example a little bit by adding a light and ground. a75dbac

@paulmasson
Copy link
Contributor Author

I like it! Gives some context without distracting from the central object. Have to remember this technique.

Personally I prefer the attractor to be a bit larger. With the default resolution of current devices, it looks a bit too mushed together at this size. Then again, devices will improve.

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