• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Click on 3d models

D

DekuNut

Guest
Originally I wanted my game to be top-down with 3d models. Everything works fine that way. Now I want to change the angle of the camera to show off the 3d shapes just a little bit, but the 3d models don't line up with the object positions anymore.

Is there a way to

A.) keep my models lined up with my object position in 3d space, or
B.) Set my object positions to their respective 3d model positions?

I need to be able to click on the models themselves (or the exact area they occupy) for my game to work.
 

TheSnidr

Heavy metal viking dentist
GMC Elder
The simplest way to do this is to create a surface, set the projection, draw each object with a distinct colour, then check the colour of the pixel under the mouse to figure out which object is pressed. If the camera doesn't move, it might even be worth it to convert the surface to a buffer so that reading from it is even faster!
This is what I do to figure out which of the rotation handles is pressed in my animation program:
https://www.dropbox.com/s/iqknpkc3o7r6v3r/RightRotationYay.gif?dl=0
 
D

DekuNut

Guest
I have to go to work right now, but let me see if I understand the suggestion:

1.) Create a surface
2.) Set the projection to the surface
3.) Draw each instance of my object as a different color on the surface
4.) Check which color my mouse is over upon left click to perform the correct 3d translation.
 
Top