asnnnnnf Posted September 1, 2016 Share Posted September 1, 2016 I am using opengl with java light weight game library and I am trying to figure out how Kevin Forbes programmed the selection of objects in the game. I can currently ray cast out of my 3d perspective camera, and have the ray detect if it collided with a box the size of the object (say a tree), but in Don't Starve, it can detect if the mouse collided with the tree outline and it ignores the transparent parts of the .png tree. How did Kevin program this? I am very impressed by it, and just can't figure it out! I am trying to implement this in code in my own game. Thank you very much for responses! Link to comment Share on other sites More sharing options...
asnnnnnf Posted September 4, 2016 Author Share Posted September 4, 2016 I figured it out Link to comment Share on other sites More sharing options...
Arkathorn Posted September 20, 2016 Share Posted September 20, 2016 If you figure out the answer to a question posed on the forums, please post it so that others may learn. I assume you calculated the impacted pixel of the texture, and then referenced it with a byte array? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.