playMaker

Author Topic: get/set vertex color  (Read 305 times)

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 298
    • View Profile
get/set vertex color
« on: October 25, 2019, 06:13:13 PM »
Hello!

I am trying to paint vertex values on to a mesh one at a time.

I wrote a shader that allowed for the adjustment of vertex values.  It works.
I have a raycast/mousepick that detects a mesh, stores its vertices in the array, and reads/writes the colors for each vertex in another array.  It works.
If I click, it should apply a predetermined color to the vertex nearest the click.  This is where the problem is.  Instead of adjusting one vertex, it makes the change to the entire model/all vertices at once.  I just need to know how to change the color value for one vertex, and effect only that vertex.

I'm using Array List Get/Set Vertex Color, and I've tinkered with Operate on Vertices, but I'm unable to get this to work!  Thank you for any help.

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 298
    • View Profile
Re: get/set vertex color
« Reply #1 on: November 06, 2019, 12:38:28 PM »
So many views.  So few answers. 

Someone must have done this.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14703
  • Official Playmaker Support
    • View Profile
Re: get/set vertex color
« Reply #2 on: November 12, 2019, 11:31:49 PM »
Hi,

 you need to do this step by step.

- work on a very simple quad to make sure data is not overwhelming
- get vertex colors, check they are correct
- set vertex colors manually, check they are correct ( get colors again and see if it matches)
- now you can implement raycasting, debug which vertex you want to adjust color with, once that's correct, you can start adjusting colors in the arraylist.

where are you within the above points?

Bye,

 Jean