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.

DarkBASIC Discussion / mouse controlling object on the matrix??

Author
Message
aprilfan
21
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Hell
Posted: 18th Dec 2002 02:21
ok I have a character in the center of the level with an over head veiw and I wnat the mouse to control a cylinder that is anchored to the matrix and for the character to always face the cylinder... How do I get this to work???
We could have handled that better.
DEANO
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United States
Posted: 18th Dec 2002 03:23
This might help you a little.
Found this snippet on my HD,don't know who wrote it.
Deano




sync on
autocam off
set camera range 10,10000

make object cube 1,100
color object 1, rgb(255,0,0)

make object plain 2,500,500
color object 2, rgb(0,255,0)
xrotate object 2,90
position object 2,0,-30,0

do

if mouseclick()=1 then move object 1,25

point object 1,object position x(1)+(mousex()-320),object position y(1),object position z(1)+(240-mousey())

position camera object position x(1),550,object position z(1)-800
point camera object position x(1),object position y(1),object position z(1)

sync
loop

"In this house we obey the laws of thermodynamics!"
--Homer Simpson, in response to Lisa's perpetual motion generator

Login to post a reply

Server time is: 2024-03-02 17:36:43
Your offset time is: 2024-03-02 17:36:43