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

Feature request: adding texture #4

Open
gerchicov-bp opened this issue May 27, 2019 · 4 comments
Open

Feature request: adding texture #4

gerchicov-bp opened this issue May 27, 2019 · 4 comments

Comments

@gerchicov-bp
Copy link

No description provided.

@LuizZak
Copy link
Owner

LuizZak commented May 27, 2019

Rendering sort of falls out of the actual core scope of the library.

I have a (very hacky) OpenGL demo scene set up, but it really should only be seen as a way to efficiently visualize the physics state on that demo app alone.

But, since you have access to the geometry as well (by inspecting Body.vertices), you should be able to implement proper texturing support in your rendering engine of choice.

@gerchicov-bp
Copy link
Author

@LuizZak I saw a lot of examples/tutorials/engines but no one describes how to apply soft body physics and texture simultaneously

@LuizZak
Copy link
Owner

LuizZak commented May 29, 2019

Hmm I see. Triangulation of the shapes can be done as a first step (I actually triangulate it in the demo code and that can be copied over), the next step would be to map the resulting polygons into with a reference UV somehow.

I explore this concept and implement it in the demo scene later when I have the time!

@gerchicov-bp
Copy link
Author

@LuizZak
It may help:
http://2sa-studio.blogspot.com/2014/05/soft-bodies-with-cocos2d-v3.html

The example doesn't work by itself (because cocos2d-objc is no longer supported). It explains how to create arrays of vertices for circle but the "drawing" part purely consists of deprecated code which is no longer supported.

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

2 participants