Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How do I get an objects color?

Author
Message
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 20th Nov 2017 11:31

I'm playing around with a pixelart drawing program for VR. I have found out how to get an image into a memblock and then converting each pixel to a plane. And I can colorize each plane with setobjectColor (GetObjectRayCastHitID( 0 ), cRed, cGreen, cBlue, 255 ). However, when I wanted to save those planes back into the image memblock, I had no idea how to get the planes color. How do I get an objects color?
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 20th Nov 2017 11:38
I don't think you can. I'd store the colour data in an array and retrieve it from there when necessary.
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 20th Nov 2017 13:17
A color array sounds like the way to go! The only problem is that I have an array of planes, imgArray as integer[15,10], and I need some way for GetObjectRayCastHitID( 0 ) to detect that it has hit, say, imgArray[2,8]

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 20th Nov 2017 13:34 Edited at: 20th Nov 2017 13:36
I'd use a typed array.



Then when you get the object ID after raycasting, you can look up the colour values in the array.
Click here for VR Legend of Zelda stuff
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 27th Nov 2017 16:54
Good suggestion - It took a while before I truly got it, but then It was surprisingly easy.

Login to post a reply

Server time is: 2024-04-24 23:01:28
Your offset time is: 2024-04-24 23:01:28