PShape runtime editing

edited December 2014 in General Discussion

Hi, is there any plans to implement methods to edit already created pshapes - like changing textures, uv or even sets of vertices? Especially with obj loading it is quite problematic right now, as the textues can only be read from the material file..

Tagged:

Answers

  • I don't know for obj but for svg you can change the vertices in JAVA2D mode (P2D/P3D is bugged).

    I'm also working on a library and I need to be able to change paths soon. But that probably won't include obj types.

  • i'm looking for a way to have a GROUP shape where I can translate child-shapes, I can remove child shapes, each child has its id and I can mouse picking each child.

    so when that's part of your lib....

    ;-)

  • These things are already possible. See the javadocs.

    @damjan: for existing shapes you can set vertices, texture, colors, stroke, fill, uv coordinates, etc. It's usually with the setXXX() command, in some cases with the index of the affected vertex as a parameter.

    @chrisir: this is also already possible. You can translate PShapes, so you can translate child-shapes (which are PShapes as well).

    So my general advice here would be: look at the reference and the javadocs.

  • edited December 2014

    i was going through the javadocs on pshape, but texture, setTexture most of the other methods didn't work.. (with a given shape). They throw no errors, but don't change anything on the shape either.. my guess is that i have to lock and unlock the shape, like with pixels, but haven't figured out how.

    just a wild guess from my limited understanding of the inner workings: A a pshape can host different kinds of geometry/ textures, and have different method calls, that are all send as one package to the gpu-buffer. Therefore it is not easily possible to just change a texture, as it doesn't specify where in the stack it is to be replaced.

  • @Damjan What renderer did you use?

    And changing a texture shouldn't be hard but the PShape department is a bit buggy.

  • edited December 2014

    @clankill3r - you are right, i just tested it with a "selfmade" Pshape, texture switching works.. P3D renderer.

    as for loaded objs - i forgot about child shapes - sometimes textures/vertices have to be set there.. now everything works fine thanks!

Sign In or Register to comment.