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 / Pick Screen - RTS 3d style mouse movement (I have sort of got it)

Author
Message
Uber Ker Noober
17
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Sheffield, UK
Posted: 15th Jul 2007 03:22
Okay so I am trying to make a cube move with the mouse so that it is on the terrain. The only problem is that it doesn't go to the top of the screen. I know I am using pick screen incorrectly but I need a way for the cube to always be y=0



Please could somebody give me a simple code that will mean the cube is always a mousex() and mousey() but at y=0
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 16th Jul 2007 03:55
This does what you asked, although it doesn't follow the terrain.
I tried to explain how I did it in the code.

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th Jul 2007 04:39 Edited at: 16th Jul 2007 04:47
@Crit: Nice code, it actually helped me out Any ideas on how to have the Y height be something other than 0?

I'd like to see different methods from other people as well, so long as they help the poster of this thread, that is.

Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 16th Jul 2007 05:26
@Sixty Squares:
I guess you could do something like this, as long as the y height is less than your camera height:

mult#=abs((camy#-yheight#)/yv#)

I didn't try that out, but I think it should work.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th Jul 2007 14:02 Edited at: 16th Jul 2007 14:03
It worked! Thanks Now for someone else to answer the original post...

Login to post a reply

Server time is: 2024-11-26 12:30:11
Your offset time is: 2024-11-26 12:30:11