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

Added getVertexData() and getMatrix() to PShape #4373

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codetorex
Copy link

Hello,

In PShape class there is methods for change matrix of the shape; like translate, rotate etc. But there is no function to retrieve this matrix. Which is important for being able to copy shapes manually and create a shape from previous shape by applying some transformations. (There is static copyMatrix function but it also not public and marked as unapproved and only used by createShape that uses another shape which only does automatic copying)

Also another missing functionality was accessing raw float[] per vertex data. It seems possible to add new vertices by giving raw float array (shown in reference but I couldn't find in code, is it removed?) but is not possible retrieve it. Currently it is required to access this data by calling these functions getVertex, getTextureU getTextureV, getNormal etc. Still there is some other data (like per vertex material data) that is not accessible might be lost. It would be great if it is possible access it directly for the purpose of copying with applying different transforms.

If this changes are approved, copyGeometry function could use this getVertexData and copy the geometry by directly copying the float array.

Thanks!

@diwi
Copy link

diwi commented May 30, 2017

still important.

@bmFicg
Copy link

bmFicg commented Jun 14, 2017

Does this work with Processing ?

@micycle1
Copy link

@benfry, @jeremydouglass Can this be merged?

@JM-FRANCE
Copy link

JM-FRANCE commented Nov 17, 2020

this is still very important. Setting also a matrix would be needed. Could this be merged in?

@jeremydouglass
Copy link
Contributor

Hi @micycle1 -- sorry for delayed reply. I'm a community member, I don't actually have control over merges to this repository.

My guess would be that new features on PShape like this might be proposed as an issue / PR on Processing4 https://github.com/processing/processing4/ and ben and sam would look at it there -- but that's just a guess

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.

None yet

6 participants