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 Professional Discussion / Creating a Level Editor

Author
Message
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 25th Mar 2008 17:11
Cool! Gonna test now ^^

Your signature has been erased by a mod because it was too big
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 25th Mar 2008 17:14 Edited at: 25th Mar 2008 17:14
Not much to test just the gui, but give me some time to add the rest, I have to rewrite alot of it.
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Mar 2008 17:58
Cheers back at ya!

Question - You wouldn't feel it a rip when my editor gets a standard interface to with certain aethetic niceties will ya? Same for Roller Wheel Throttle (Never thought to add zoom - in game yeah... not in editor) ...hmm...

I can say my editor is going to be a little different than the others... because my approach I think is different - and rather complex... which means it will be quite a milestone if I can pull it off!

First of all - its going to be tailored around my OOP Code (DarkGDK) and the Editor and Game will share the same LOAD/SAVE routines...

Also... unlike most editors - I'm actually making FRUSTRUM CULLING part of the design process.. so you can go 100% custom, implement a QUADTREE and leave like that, or Set up a QUADTREE or custom configuration, and then layer in object placement in their own groups or contained in particular QUADTREE BOXES or Hand Placed "boxes" etc. Why? MY Frustrum system is heirarchy based, and as such allows for human design, quadtree, mix-n-match... and even handmade portal systems.

The other thing I'm going to TRY to do is implement SHADERLESS SHADING - Where you literally can paint TEXTURES In the editor... AND/OR... Set up Auto Blend - and it does what various Terrain Shaders do.. but actually mixes them down into output textures.

I'm also going to have object placement as well - and do what I can to make both a SHADOW BURNIN TOOL (Where it literally burns shadows into your main textures) and a LIGHTMAP Maker, where you drape it across the land. I want to do this like TED almost did - where placed Objects cast shadows etc. (Ted's is pretty Buggy... Funny - Version 5 - no issue - but has texture bleed seams... (from the light map turns out).. but Version 6 - no seam - but Light Mapping broken... UGH!!! )

Basically I TRIED to go 3rd party - and it just won't do except in the case of 3DWS + PixelPErfect's DarkGDK importer for it - so you get WYSIWYG capabilities.

But - this will take monthes to do... Especially the CAMERA RECORDER and Action RECORDER I plan to add.... And the Weather settings... And the Script Triggers and ambiant sound placement, not to mention music regions and SCIRPT controlled "tempo and music changes"

Iron Infantry won't be out for awhile eh? Haven't even mentioned the DarkAI implementation I want to add to the editor! Geesh!

Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 25th Mar 2008 18:29
Ah the GUI was beatiful! Also i suggest no using Matrix cuz they are slow! Just to save you little FPS

Your signature has been erased by a mod because it was too big
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 26th Mar 2008 15:41 Edited at: 26th Mar 2008 15:50
Tiny updates, added the mouse wheel zoom and rollbar with drop down menus, also objects highlight as you go over them.

The matrix didn't slow my fps down one bit, I still get over 2000 fps. Though i'm not using it in the final, but for now it will do.

P.S. Does any one know what that DLL's is for the windows standard file selector and how to use it?
draknir_
18
Years of Service
User Offline
Joined: 19th Oct 2006
Location: Netherlands
Posted: 26th Mar 2008 20:57
superb looking GUI in that download Sasuke.
cjb2006
19
Years of Service
User Offline
Joined: 20th May 2006
Location:
Posted: 26th Mar 2008 23:13 Edited at: 27th Mar 2008 04:02
I personally like it if the wheel zoom is more exponential, kinda like this:

Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 1st Apr 2008 18:06 Edited at: 1st Apr 2008 18:07
@cjb2006, good idea, but only use it on selected objects.

Hi guys, got some problems, text problems. I can't figure out how you stop blank space when using the entry$(1) command. Also how do you limit the entry to say, 3 charaters and only numbers or letters. I need it for the editable boxes, such as speed and names etc...
The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 1st Apr 2008 21:01
Haven't been around for a while. Nice to see this project is still being worked on. Excellent GUI btw!

Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 1st Apr 2008 21:13 Edited at: 1st Apr 2008 21:21
Cheers ARRAYinator, once I get this entry thing out of the way I can really get coding.

Since every thing is made in DBP, heres a sprite of a save button in code.


How about a folder:


Hehe
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 1st Apr 2008 22:48
Fantastic!

Your signature has been erased by a mod because it was too big
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 2nd Apr 2008 15:43 Edited at: 2nd Apr 2008 15:44
Finally got those stupid edit boxes working, you can now click on the speed and wheel step box at the box to change the value.

Click on it, backspace the value then input your own, press the return key or click off the box to accept the new value. It will update the camera speed or mouse wheel zooming speed.

Speed is limited to: 0.01 - 100.00
Wheel Step is limited to: 0.01 - 5.00

To control the camera, still hold right mouse button.
MaraBane
17
Years of Service
User Offline
Joined: 21st Jan 2008
Location:
Posted: 4th Apr 2008 04:13
nice works great more than what i could do are you and if you are how are you going to distribute this? download or site selling on cd and if you are going to sell it how much?
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 11th Apr 2008 17:45 Edited at: 11th Apr 2008 17:49
I don't know if that last download came out right, the weirdest thing happened, for some reason I hade to add a -1 on each of the x axises using the line command, when I didn't before. Hmm... sounds like a problem with DBP to me.

I need a file selector for saving/loading/importing/exporting etc... I heard there a DLL you can call for this, but its hard to search for something when you don't know what its called. I make my own eventually, but for now it would be handy. Does anyone know what the DLL is call and how to use it or what to search for on google? Thanks in advance

MaraBane, I believe I answered this awhile back and I wanted to just use it for my games and for others to mod my games. But distributing a free edition with basic level editor functionallity for DBP users is not off the table.
MaraBane
17
Years of Service
User Offline
Joined: 21st Jan 2008
Location:
Posted: 14th Apr 2008 02:48
ok i guess i just didnt see the post i spent so long readin this maybe my mind started to wander and i just didnt read/remember it but im glad to hear this ive been trying to find a free level editor for a long time(a good one) and i cant seem to find one that works for me. im getting really tired of hardcoding every little bit of the world.

and by the way does anyone know if there is a way to use your own files for an avatar(sasukes name jogged my memory of wanting to) i have a scan of my drawings i want to use. sorry for the off topic question though

On the path i walk i must do anyhting to gain power... even if it means selling my flesh to the devil.
bjadams
AGK Backer
17
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 14th Apr 2008 09:03
works fine for me.

i am currently looking for an editor system that allows me to import .x objects, lets me place them in a world, and then save out their "xyz positions" and camera rotation/movement co-ords in text format so i can easily integrate in my dbpro code.

will the AxisEd be able to do this?

Are there any other "out of the box" editors that I can use, or do I hav eto write my own?
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 14th Apr 2008 14:31 Edited at: 14th Apr 2008 14:35
Currently AxisEd can do all that, plus I can customize the way the file stores information by just changing the custom template file:


So if I want to have the angle values before the position in the file, it would look like this:


Not only that, I can store what I want to store. If I wanted just the position/angle xyz, object path, textures , shaders. It would look like:


<texture[0][1]> = texture stage 0 and 1, there will be two texture paths in the file. Though I don't use this method for my games, I have a special system for hanlde objects, textures and shaders.

But making a simple editor is not that hard though.
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 2nd May 2008 23:54
Just would like to ask a question I asked before,

I need a file selector for saving/loading/importing/exporting etc... I heard there a DLL you can call for this, but its hard to search for something when you don't know what its called. I'll make my own eventually, but for now it would be handy. Does anyone know what the DLL is call and how to use it or what to search for? Thanks in advance

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd May 2008 02:01 Edited at: 3rd May 2008 02:04
Off the top of my head? No. Search term... probaly along the lines of WIN32 Common Dialog. there are Win32 calls you make and get the printer dialog, color selector, and various "flavor" of file dialog like you're mentioning.

If you're doing DBPRO... than this might MIGHT be tricker.. and if so I'd suspect IanM has a plug in.. also there is this GUI someone made that's kicking around in the DarkGDK forum somewhere but it started over here... he basically wrote a bunch of hooks into the Windows API and more or less "brought them" to DBPro is a digestable way... not BlueGUI either...plus its free... sorry I can't remember the name... hmm...

Good Luck Bro!

[edit]DUH.. Aaron Miller right up on top of this Page... WinGUI... Argh... sorry Aaron! Wouldn't forget ya on purpose![/edit]

Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 3rd May 2008 02:41
Cheers jason, file dialog... made the search so much easier, found this by Kelebrindae:



May take me some time to understand it all but it works. When ever i'm coding a project I try to use the least amount of DLL's(only windows stuff, user32, kernel32, that kind of stuff) as possible, DBP all the way. Call me mad but thats how i've always done it.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 6th May 2008 06:04
Awesome .. Glad to help.

Hey - I can't help but show you how some "Pieces" of my LEvel Editor are coming together... I've switched to the Dark side.. but check this out (Will be two posts - one to show the GUI (WIP) and one to Show How the Level Editor Interface "MIGHT" look ... just did first 3d terrain + GUI Meld.. and the results are attached pics.

First The GUI so far....

jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 6th May 2008 06:05
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 6th May 2008 06:06
Last Gui shot before the Terrain + GUI shot ..... This one has a Neat 3d cube tectured with the Window in focus!

jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 6th May 2008 06:09
Ok - the final shot attached - GUI "draft" + Some Terrain... shows that the two "systems" are coming together I think finally... hope noone minds the multiple posts - I'm rarely around these parts lately ... this seemed valid considering the thread title and all... Here it is... a peek into how my Terrain/Level Editor is going to look more or less...

(Note I have very slow PC.. so in Windows Windowed mode 30fps is pretty decent actually.)

Sid Sinister
20
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 6th May 2008 06:43
Looks pretty sexy Jason. Good work =] Shoot me an email once in a while man, let me know how things are going with your projects (I'll be in FL until Saturday, so if you do so this week, you'll have to wait for a response).

The steam was let out of all my programming projects when my classes started getting difficult a few months ago. Tersculpt was great to work with and stuff but, I don't know. Coding seems not fun to me right now. I much rather enjoy game design or modeling than programming, at least for right now.

Plus I'm frustrated by BASIC. I'm not even ragging on DarkBASIC here because it's great, but... I just need to break out. I guess the two reasons I'm hanging out is A) To see what DBPX10 offers and B) The community is amazing. I should probably start doing something constructive here again though. I was helping out on the DBP boards for a while but...

Wow, sorry to kind of go off on a side rant with your thread Sasuke. You and Jason are gods if that makes you feel better I love following both of your work. I wish I had Sasuke's editor knowledge and jason's 3D knowledge. Then I could be like Van B!

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
-Computer Animation Major @Baker.edu-
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 6th May 2008 14:52
jason, nice work, did you make those windows with DBP/GDK code or something else?

Sid, an editor is only as hard as you make it, in my case a monolith of a task. But a simple editor is very easy to make, it just depend on what you need. If you know how to make functional windows(don't even need them) and buttons then you can make an editor cause they'll be the hardest parts(except for external file stuff, but this is a simple editor).

I revitalize my coding spirt with mini projects, like making a simple music player or clock or Killer Cubes game where you have to dodge Cubes textured with teeth. Something fun like that works for me, anyway... hope you get back in there

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 6th May 2008 19:56
@Sid Sinister -
Quote: "Looks pretty sexy Jason. Good work =] Shoot me an email once in a while man, let me know how things are going with your projects (I'll be in FL until Saturday, so if you do so this week, you'll have to wait for a response). "
Thanx and don't hestiate to drop me a line too.. I'm forgetful but always like getting and responding to your emails Sid!

As for coding not as fun as modelling etc.... I go through phases too.. I like modelling and I'm a newb to that but its fun... different mindset... um... I'm a musician.. I go through cycles of just that.. or just playing games and not coding at all.

Try tnot to burn out ... variety is good.. and Like Sasuke said.. break things up to smaller parts... then its more like building with legos than writing a dictionary on the english language!

Also thanx for the compliments all around... you're a true player here yourself!

@Susuke - Hi!
Quote: "jason, nice work, did you make those windows with DBP/GDK code or something else? "
Thank You, and pure DarkGDK... sprites here.. but the gui stuff is rendered in a memblock.. and only if the "PaintToSprite" flag is rendered does it become an image and go to a sprite. this has a neat side effect in that a 3d gui with controls etc is defaintely possible.

I was thinking adding paralax to it to get 3d looking gui surfaces too... like the buttons going up and down LOL... think that would be Tough!

I have so much more to do however... file dialogs, maybe print dialogs, all the basic controls etc..

I've been busy - just in the DarkGDK forum more these days... Check us out.. .. look in the DarkGDK oop thread.. Did you scope out my DBPro Ironinafantry "abandoned-ware" release? Its not a full dbpro game but fun... I'm full rewrite of Iron Infantry in DarkGDK now.

Sorry to go off topic..haven't been around this forum much wanted to catch up - miss you guys!

Back to topic, I think level editors are as hard as the games themselves... I'm trying to make mine more of a API editor than a "generic" level editor... lke I have a class that can load and parse bitmap fonts... I'll have a "utility" in the "Level Editor" for this purpose of loading a group of fonts, and then you can save this "configuration" and use it for other parts of the "level" too.. sound strange? Think of it as the difference between writing a windows app in pure code and using a program that lets you draw the windows and a lot of the work is done for you... that's the approach I'm after... It will do things you expect from a level editor... but it will also be a WYSIWYG "utility" for my entire DarkGDK OOP Library of code I've been working on the last 4 to 6 months.

Must Program
17
Years of Service
User Offline
Joined: 22nd Nov 2007
Location:
Posted: 23rd May 2008 22:19
wow its looking cool sasuke can i have the demo when its done to create levels please

Working on The Hunt and 7 Stages both are text based games want a demo of either then just ask.
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 23rd May 2008 23:19
Cheers, but it's going to be awhile until it's working to my preferences.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 13th Jun 2008 20:03 Edited at: 13th Jun 2008 20:03
Another GUI edit, this one is 3 times faster than the last one, pic:



I noticed that it needed to be streamlined to perfect performance, so i'm rewriting a ton of stuff.

Any updates on anyone's elses editors?

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Violent Pigeon
17
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 14th Jun 2008 13:12
Wow, that UI is sweet, cant wait for more screens of the in the editor stuff.

My MMORPG: http://green-man.pbwiki.com or check out the forums at http://mechtech.webmmorpg.net

jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Jun 2008 14:59
Here Here! Sasuke - Sasuke - YAY! (Seriously - looks WOW)

Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 7th Aug 2008 14:18
Man it's been awhile, been out of commision. Anyway I'm still at it, so new stuff soon. As much as I want to continue writing from my iPod I'll leave it at that, see you guys soon.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Try
20
Years of Service
User Offline
Joined: 16th Aug 2004
Location:
Posted: 9th Aug 2008 00:03
Sasuke,
I've always had an eye on this topic. Feed us with some new screen shots, and don't make us wait...

Cheers,
-Try
Sixty Squares
19
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 9th Aug 2008 00:34
@Sasuke: Wow.

Sid Sinister
20
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 9th Aug 2008 18:16
Holy hand grenades. There is nothing like seeing how much DBP can do with the right people, to make me feel so small.

I didn't even notice there were comments directed at me above from May! I was on vacation starting the 6th, so that's probably why I didn't get it and then I suppose the thread got pushed to the bottom of the list.

But thanks for the advice

I'm waiting until I learn C++ or something to build my own editor and game engine from scratch.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
-Computer Animation Major @Baker.edu-
Xsnip3rX
18
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 13th Aug 2008 08:54
Well, all i can say is, DAMN THAT LOOKS BITCHIN., ahem... good job

Lancewrath
22
Years of Service
User Offline
Joined: 30th Dec 2002
Location:
Posted: 13th Aug 2008 18:06 Edited at: 13th Aug 2008 18:08
still working on my own UI, finally kicked dev-cpp in the nuts called it grampa and made it submit. lol




Great job on that. looks very cool

LIKE OMFG IM TEH KING OF TEH INTARWEB!
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 27th Sep 2008 05:50
No where to start what? An editor or something else. You wouldn't be learning much if it was all given to you.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 27th Dec 2008 00:11 Edited at: 27th Dec 2008 00:11
Wow, it's been awhile, would just like to say that I haven't stopped on this project just that i've been busy learning and building my skillz and now I can pour them into this project, since I need a new editor for my Fallout 3 Engine Remake

Anyone else still making editors, it's been a long while since I last saw Lancewrath around here, I wonder what he's up to

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Xsnip3rX
18
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 6th Apr 2009 13:34
Bump, let's get an update...

NightX
16
Years of Service
User Offline
Joined: 3rd Apr 2009
Location: Australia, QueensLand
Posted: 6th Apr 2009 15:17
Wow great work man, this project looks SWEET

LoST The beginning of the EnD
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 7th Apr 2009 15:49 Edited at: 7th Apr 2009 15:52
Xsnip3rX, Wow... never thought anyone would bring this up again but I'm glad it's still alive. As for my Editor, I stopped making it for awhile because I needed to work on my engine that the editor ran off.

NightX, Cheers.

At the moment though I'm making a simple editor for just position/rotation of objects and outputting the coords, so i'll make it available when its done. It will run on my new Steam based Gui, pic:



I was hopping if we could make this thread more of a discussion like it was in the past, so I have a question to start it off. What does and Editor need, be it the way it functions or feature set, either for a general editor or one running off an engine?

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
lucifer 1101
16
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 8th Apr 2009 03:24
what would you think about adding in shaders to the editor???

and maybe a properties editor that can change some information about the different objects that have been placed...
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 2nd Jul 2009 23:22
Oh yes, it back, the biggest creating a level editor thread and my god as it been awhile. I cooked this up again cause I working on my and i'm looking at recreating my 3D Gizmo, also i'm going to start make these editor elements and releasing them, 3D Gizmo will be the first. Here's what i'm planing to make:



The is the 3dsMax one btw, though i'm going to change the scale one to be more like the Offset Engine's one. So am I right in thinking that:

1. The gizmo scales based on camera distance?
2. They are a collection of objects, like cones, plains, cubes and triangles (thank Math) wireframed for lines.
3. Not limbs since they require object diffuse altering and pick for selection.

Making it isn't that hard but getting the the inital gizmo setup right is a must or there will be hell later trying to get it to work corrently.

Also how do you move and object along an axis based on the mouse screen coordinates, but also including factors like object angle, camera position and angle.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Jul 2009 23:54
If you incorporate nice big plains into your gadget, then you could check those for 3D mouse position. I would make a plain and position it with the gadget, then orientate it according to whatever axis you want to adjust.

For instance, if the plain is flat like a ground plain, then it would be used for X and Z movement, by checking the plain for PICK OBJECT with the mouse coordinates you'll get the exact 3D position of the mouse. By working out the X Y and Z differences when moving the mouse, you could affect your gadget with the same movements. That means real easy dragging in 3D.

But one helluva neat bonus comes when you orientate the plain to the camera, because then the gadget can be dragged with X, Z and Y, at a fixed distance from the camera - just like those fancy modelling apps but without the horrific vector math.

I've given this some thought, and it's how I plan to do it in Tersculpt2, having good 3D dragging over the terrain and orientated with the camera should cover any grounds I need, coupled with a straightforward height adjustment too of course.

I would make the gadget in 3 bits though, just make the object with each axis seperate, then load each object in. This way, you could do something like this:

load object "axisX.x",1
load object "axisY.x",2
load object "axisZ.x",3

Then each loop:

mb=mouseclick()
mx=mousex()
my=mousey()

if mb=1
p=pick object(mx,my,1,3)
if p=1 then text 0,0,"Clicking on X"
if p=2 then text 0,0,"Clicking on Y"
if p=3 then text 0,0,"Clicking on Z"
endif

Then if you check for the mouse button being held, it's easy to move the gadget based on mousemovex() and mousemovey().

I'm sure this is not news to you Sasuke, just elaborating a bit in case anyone is considering this stuff too.


Health, Ammo, and bacon and eggs!
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 3rd Jul 2009 00:14
Cool beans, I never thought of using the plains in that way, so cheers

Ok i'm going to start work on this, post back soon.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 5th Jul 2009 21:34
This harder than I thought, I can't figure out how to do the movement accurately where the axis pointer stays under the mouse. I tried mousemove but it doesn't work well with angle or I don't know the correct setup, using pick vectors I got pretty close but still not accurate enough. Anyone able to help?

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
AndrewT
18
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 6th Jul 2009 04:31 Edited at: 6th Jul 2009 04:32
Quote: "This harder than I thought, I can't figure out how to do the movement accurately where the axis pointer stays under the mouse. I tried mousemove but it doesn't work well with angle or I don't know the correct setup, using pick vectors I got pretty close but still not accurate enough. Anyone able to help?
"


Setup three planes, each one lined up on a different axis. These planes should be positioned at the gizmo, and they should be very large.

When you're dragging the gizmo, call Pick Screen twice. The first time, call it with the moue coordinates and a very small distance value, like 0.1. The second time call it with the mouse coords but with a large distance value.

Now call Intersect Object and pass in the two 3D positions you obtained by adding the pick vectors to the position of the camera. Take the distance that is returned, and call Pick Screen a third time, this time passing in the mouse coordinates and the ditsance you just found. Then if you add the pick vectors to the camera position you get a position that is right under the mouse.

If you need any help implementing feel free to ask.

i like orange
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Jul 2009 15:47
If you are using plains, then really you should be able to drag objects with that.

Like work out the difference between the new clicked position and the last clicked position - so you'd have something like a 3D vector. Maybe...

lastmb=mb
mb=mouseclick()
mx=mousex()
my=mousey()

if mb=1
p=pick object(mx,my,1,3)
if p>0
`Nab old positions
posb_x#=posa_x#
posb_y#=posa_y#
posb_z#=posa_z#
`Work out new ones
posa_x#=camera position x()+get pick vector x()
posa_y#=camera position y()+get pick vector y()
posa_z#=camera position z()+get pick vector z()
`And if it's a fresh click, cancel any differences
if oldmb=0
posb_x#=posa_x#
posb_y#=posa_y#
posb_z#=posa_z#
endif
mov_x#=posa_x#-posb_x#
mov_y#=posa_y#-posb_y#
mov_z#=posa_z#-posb_z#
endif
endif


Then you should have a set of floats, mov_x#, y# and z# - they hold the movement values, apply them to your selected object and it should be dragged along with the mouse.

Using Pick Object is pretty vital I think, it's the only way to do this without a whole lot of math, I mean with pick object, it's practically done for you already.


Health, Ammo, and bacon and eggs!

Login to post a reply

Server time is: 2025-08-09 01:38:31
Your offset time is: 2025-08-09 01:38:31