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

Triplanar or cube mapping, together with marble's rotation can be used to add skins to the marble #44

Open
Ekozmaster opened this issue Mar 7, 2019 · 5 comments

Comments

@Ekozmaster
Copy link

The titles says it all. Maybe, with access to the marble's rotation, using triplanar or even cube mapping it would be possible to implement a skin system for the marbles.

@Ekozmaster
Copy link
Author

There could even be a "skins" directory to allow players add/remove as many skins as they want.

@HackerPoet
Copy link
Owner

The marble currently does not rotate, that would have to be added in to make it work if you want anything but a solid color.

@HackerPoet HackerPoet reopened this Mar 7, 2019
@Ekozmaster
Copy link
Author

Hm... Is that hard to add angular momentum for now? maybe in the future that might be a feature...

@MichaelMoroz
Copy link
Contributor

MichaelMoroz commented Mar 8, 2019

Hm... Is that hard to add angular momentum for now? maybe in the future that might be a feature...

Actually, it's not that hard. Add a quaternion to represent the marble orientation and a angular momentum vector, a sphere has just a unit inertia tensor, and we can integrate it using Euler's method. Though, the biggest problem would be in finding the torques.
One approach I can think of: torque = cross(fractal velocity times distance from nearest fractal point(NP) to marble surface, NP - marble center position).
I would also add a friction force to angular momentum when colliding with something(proportional to the difference between fractal velocity and marble surface velocity at NP).

To get a more accurate torque you would need to sample all the points inside the intersection of the marble and the fractal - not a simple task I would say.

@Ekozmaster
Copy link
Author

I think a pretty physically reallistic torque implementation would drastically change the gameplay, thus causing the high scores of the community to change a lot, kind of reseting the game's identity in some sense. One approach would be to keep the physics interactions as it is, just add friction to rotate the marble, so that angular momentum wouldn't affect the rigidbody's linear momentum. That would imply in some heuristic approach to solve the problem, instead of a logical implementation, but a self moving sphere isn't the most reallistic thing i've ever seen. Is good to stick into a more arcade mechanics style :)

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

No branches or pull requests

3 participants