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.

Newcomers DBPro Corner / Selecting a 3d object with a mouseclick

Author
Message
Zinc Avenger
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location:
Posted: 19th Jul 2003 23:23
I've been thinking about how to select a 3D object with a single mouseclick.

The only way I have managed to do this is to record the co-ordinates of the mouseclick, then freeze the game, remove all textures, fullbright all the objects and make them white, then make one object red, see if the mouseclick co-ordinates return a colour value of red, then if not colour next object red etc. and finally return lighting and textures to normal.

This actually works, I won't bore you with the code here, but the problem is that it is fantastically ugly for the screen to flicker like that in the middle of a game. Can anyone think of a way for this to happen without actually letting the player see such an horrifically ugly effect interrupting their game?

In other words, can I find the colour of a specific point on the screen without having to show that screen to the player?

Or is there another way of doing this?
Dmitry K
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Russia
Posted: 19th Jul 2003 23:47
Zinc Avenger
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location:
Posted: 20th Jul 2003 00:00
You, sir (or madam!), are a genuine wonder.

I thank you.

Login to post a reply

Server time is: 2024-11-24 22:59:47
Your offset time is: 2024-11-24 22:59:47