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 / Someone please help!

Author
Message
emmjay2
19
Years of Service
User Offline
Joined: 5th Jul 2007
Location: NW , UK
Posted: 5th Jul 2007 15:26
I'm making a level editor in a 3D environment and I'm having trouble with the tool.

You use the mouse to move a tool across your level and it works fine when camera angle y() is set to 0. But if I move the camera to a different angle, the tool still moves like it did when the camera angle was set to 0

In other words, if I moved the camera round to an angle of 90 (y axis) and I moved the tool upwards with the mouse, the tool appears to move left on screen. Its so annoying!

Can someone please tell me how to change this?

my names emmjay
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Jul 2007 15:49 Edited at: 5th Jul 2007 15:53
The simple way is to create a hidden object, orient it to the same direction as the camera, and move it with the mouse. Your tool should then be coded to follow the hidden object.

You could also consider using EzRotate, and the tutorial I wrote to do exactly what you are doing...

http://www.thegamecreators.com/data/newsletter/newsletter_issue_47.html#14

emmjay2
19
Years of Service
User Offline
Joined: 5th Jul 2007
Location: NW , UK
Posted: 5th Jul 2007 18:28
Thanks!

Is that tutorial for DarkBASIC professional? or the original? Because I'm using the original one. And I dont understand DLL's!

my names emmjay
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 5th Jul 2007 19:57
What I did in MatEdit was pre-calculate the movement parameters in two arrays (one for X movement and the other for Z), for all 360 degrees the camera can be rotated.

When you move the object in question, you simply use ObjMoveX(Camera Angle Y()) and ObjMoveZ(Camera Angle Y()) to move it.

TDK_Man

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Jul 2007 21:10
@emmjay2

The problem sounds similar to this:

http://forum.thegamecreators.com/?m=forum_view&t=108275&b=10

Enjoy your day.
emmjay2
19
Years of Service
User Offline
Joined: 5th Jul 2007
Location: NW , UK
Posted: 6th Jul 2007 19:46
Thanks guys!

I'll have a go and see if I can get it working.

my names emmjay
emmjay2
19
Years of Service
User Offline
Joined: 5th Jul 2007
Location: NW , UK
Posted: 7th Jul 2007 20:33
Wow! It works!

Thanks alot guys!
I've been trying to do that for ages!

my names emmjay

Login to post a reply

Server time is: 2026-07-05 16:28:31
Your offset time is: 2026-07-05 16:28:31