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.

3 Dimensional Chat / I need help with Matrix Editor (MatrixHeight)

Author
Message
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 23rd Jan 2004 09:20
how can I make the program to make hills, like in magic world.
(using the mouse).
I've found out how to move the tool object from one grid point on the matrix to another, and I can set the matrix height at ONE grid point a time. how can I make it at several times at once, so it is formed like a hill?

!Can I borrow 90$ to purchase DBp? please..!
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 23rd Jan 2004 17:42
well, I assume your program has a "if mouseclick=1 then change height of point"

Why dont you change this into
"change height of "point of mouse x&y" " + "change height of "point of mouse x-1&y" " etc

that should do it


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 29th Jan 2004 14:14
ill try it

!Can I borrow 90$ to purchase DBp? please..!
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Jan 2004 14:53 Edited at: 29th Jan 2004 16:50
Doh! - did'nt read the question properly, I thought you were coding your own editor. I'll leave my response though in case anyone finds it useful.

What I usually do is firstly store the mouse position in a variable, then I run a dummy object over each matrix vertice to get its screen position. I'd make a cube, then hide it - and use this as a 3D to 2D converter. Say your heights for your matrice were stored in an array called height#, and your matrice is 64x64 tiles at 100x100 DB units.

I'd use something like:

Make object cube 10,1 : Hide object 10

Then to ascertain the screen locations of each vertice...




This will do a little more than just draw little boxes in the right place - you can use this to select vertices, the selected vertice will be red, and the vertice under your mouse pointer will be yellow. With just a little code you can have a nice little editor.

Now that you can select a vertice, it's quite easy to adjust the height - you can do a check with the MC variable, so selecting with the left mouse button, and adjusting the height with the right mouse button is as easy as...



For hills, I would'nt recommend that you try to adjust more than one vert - I'd just make a matrice smoothing function, so you'd have jagged verts, but a couple of passes with a smooth function and you end up with nice smooth hills.


Van-B


The nature of Monkey was irrepressible!.

Login to post a reply

Server time is: 2025-06-28 21:40:05
Your offset time is: 2025-06-28 21:40:05