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.

Author
Message
Zaine
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 23rd Nov 2005 18:54
i am trying to make a box move in 3D using my mouse in DBPro. i have tried the mousemovex() and mousemovey() and i have told iot to move that abject.. but it wont work.. what am i doing wrong?
ThinkDigital
19
Years of Service
User Offline
Joined: 18th Aug 2005
Location: A galaxy far, far away...
Posted: 24th Nov 2005 21:02
Quote: "what am i doing wrong?"


Let's have a look at the source code.

AdamGameSource.com 3d Model Competition

Don't support the ANJL: You were a noob once too.
Zaine
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 25th Nov 2005 08:28
ok here is the code...
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Nov 2005 14:51
You have a bit of learning to do I'm afraid. In 3D there are three co-ordinates - not two like you have used (that's 2D).

The beginners tutorials may help on my web site (link in sig below).

But, the code you posted is incomplete and MouseMoveX() and MouseMoveY() are functions which RETURN values only. Use them as follows:

MMx = MouseMoveX()
MMy = MouseMoveY()

They return a value depending on how far the mouse is moved in the X and Y directions.

Unlike DBC, DBP returns 0 (zero) when not moved.

You need a Loop at the end of your code (to go with the Do) and inside the loop you need a line to actually move the object and a 'Sync' to update the screen.

To be honest, it's better to use the keyboard to move the object and the mouse to steer, but never-the-less, try altering your code like this...



And don't forget the built in help. All you have to do is click on any keyword in DB and hit the F1 key and it will tell you exactly what the command does, and an example of how to use it.

TDK_Man

Zaine
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 26th Nov 2005 22:01
ok, i tried the code out and it wouldnt let me move the box so i changed the movement up a lile to where it would work, but now when you move the mouse left or right, the bx goes the opisit diorection to where your moving the mouse.. here is the code that i have for it.

how do i reverse the mouse movements?
Heckno
20
Years of Service
User Offline
Joined: 8th Sep 2004
Location: Palm Coast, FL
Posted: 30th Nov 2005 03:25
change your "+" to "-"....
Zaine
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 30th Nov 2005 11:52
ok cool, that worked.. thanks Heckno.. might be back for more questions later..

Login to post a reply

Server time is: 2024-09-24 09:30:05
Your offset time is: 2024-09-24 09:30:05