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.

Code Snippets / [DBP] Find the Cube Side

Author
Message
luskos
16
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 7th May 2010 01:56
Hi guys,
this code was originally writen for a thread in Newcomers Corner.
It`s a way to find which side of a cube your mouse is over.You can think how this can be applied for something.The author of the thread originaly wanted to use it for his sanbox editor.It can take place somwhere.

We are using 6 dummy plains which are positioned at every cube side.Then we check if they are present at mouse position with "pick object" comand.It`s nothing complicated.

For this code you can use any image to texture the plains.I prefered 1x1 black bmp.


Happy to share!

Where there is a will, there is a way.
I often edit my posts, that`s who i am
budokaiman
FPSC Tool Maker
14
Years of Service
User Offline
Joined: 24th Jun 2009
Playing: Hard to get
Posted: 8th May 2010 19:12 Edited at: 8th May 2010 19:33
Quote: "For this code you can use any image to texture the plains.I prefered 1x1 black bmp."

Or you can replace this:



with this:



Or be even more efficient, and comment out the loading of the image and use
instead of texturing it.

luskos
16
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 15th May 2010 04:28
You are right but i don`t think that loading an image from internet is good idea, it`s not reliable.It actually can be if you load some advertise in the game, it`s good for something like this.Changing content at the site takes effect in game, it can become good trick i may use it .

Where there is a will, there is a way.
I often edit my posts, that`s who i am

Login to post a reply

Server time is: 2024-04-24 09:27:43
Your offset time is: 2024-04-24 09:27:43