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.

Dark GDK / how would i go about raising and lowering terrain?

Author
Message
Freedom Fighters
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 18th Jan 2010 07:39
ok. im making a simple terrain editor for my game so i can make maps on terrains.
im using the terrain system and not matrix but i have a problem.
say i using a area of 32x32 and with in that area i can raising and lower the terrain.

i figured out the 3d point of where im pointing at so that gives me a point.

but how would i go about raising and lowering it?

i know this will need some maths.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 18th Jan 2010 08:19
You could convert the 3D world position of the point you wish to edit into a 2D point and paint onto a bmp and use it as a heightmap.

Or you could use the vertex data commands and alter the vertex position at the 3D point.

There are some good tips I found in this thread:

http://forum.thegamecreators.com/?m=forum_view&t=158455&b=1

They are 2 ways I know of, and i'm sure that there are plenty of other and probably more efficient ways than what I am suggesting!

Freedom Fighters
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 18th Jan 2010 08:49 Edited at: 18th Jan 2010 08:51
well it loads the bmp map.
how could i change that?

EDIT: i was also thinking that since i got the 3d points. using x and z i could find the vertex points at that location by finding it by how many H x W

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Freedom Fighters
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 20th Jan 2010 09:14
hmm well. im going with editing the point by vertex. problem is finding the vertex at a x and y point to edit

im going to try a grid and sectors to work it out.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 20th Jan 2010 11:28
Post back if you work it out, it would be interesting to see what you come up with!

Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 24th Jan 2010 03:46
I was talking with Kaedroho, you may know him, he is developing BlitzTerrain.

In the end, the best method in my opinion is vertex manipulation, and looping through each vertex to find which vertex is at the point you wish to edit.

I think this may be the only way to find the vertex number, but there may be a way so that you would not have to loop through every single vertex.

I'll keep working on my vertex manipulation example and post it when I've completed basic editing.

How goes your progress anyway, may I ask?

Freedom Fighters
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 24th Jan 2010 04:14
well that sounds good. ill look forward to it.

im having some progress. im working on a system that divides the terrain area into small areas.

so i have a 64x64 bitmap i devise it in to 8x(8x8) square tiles. then from than work out the points that are with in a certain distance in that square and surrounding squares and then set their Y height.

i think that for the size of the bitmap is how many squares it is on one side by the other.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 24th Jan 2010 04:28
That is what I will work on next for my editor, but first I have to fix seams, which is extremely frustrating.

It'd be good to see some more about how you're going about splitting your terrain!

I have the vertex manipulation done, just need to tweak and optimise it a bit and it should be ready to show!

Freedom Fighters
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 24th Jan 2010 04:41
ok sweet. ill have a look at it.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 24th Jan 2010 07:01 Edited at: 25th Jan 2010 11:00
Ok I finished playing around with this one for the time being. It's pretty basic, just to learn off a bit I guess.

Code:



Media is attached. Let me know what you think, I probably won't use it again for a while but if you find anything wrong with it let me know.

Attachments

Login to view attachments
Freedom Fighters
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 24th Jan 2010 07:52
..............Speechless...

omg. this is what i was after. this is very good. i love it. its epic. its heads good, this could go somewhere. its wonder full.
using this it could me making a terrain editor. haha im getting ideas already.


as for what wrong nothing.

it scores a 10/10 for me

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 24th Jan 2010 08:52
Glad it was of some use then!

Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 24th Jan 2010 11:21
wow..... I have been looking for this

I only had problems with:

dbSetDisplayModeAntialias(800,600,32,0,8,0);
dbDesktopWidth()
dbDesktopHeight()

I could not find the commands?

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 24th Jan 2010 11:24
That's odd. Do you have the latest DGDK update? From November 08 I think.

Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 24th Jan 2010 14:15
Quote: "That's odd. Do you have the latest DGDK update? From November 08 I think."

I've downloaded now 7.4 but now I cant see the objects

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 24th Jan 2010 15:29 Edited at: 24th Jan 2010 15:30
Quote: "I've downloaded now 7.4 but now I cant see the objects"


Read the rest of that thread, you need to patch it as well.

Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 25th Jan 2010 11:01
I edited my post above, I realised that there were some useless things in it and I removed them. This gave me an extra 20-30fps on the highest level of detail.

Also Niels, did you fix your problem?

Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 25th Jan 2010 19:36
Quote: "Also Niels, did you fix your problem?"

Yes... its working now

My next plan is to save the object and load it again and then still be able to manipulate with it. I can save and load, but then I cant change the object

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 25th Jan 2010 20:41
When you save the object, do you save the mesh or the object?
I might have a play with this and see what I can come up with.

Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 25th Jan 2010 21:05
Niels, I encountered the same problem as you, until I realised that the new vertex data was being stored onto a different limb (limb 0, instead of limb 1).

Here is updated code, showing loading/saving:



Give that a go and get back to me if it helps with your problem!

Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 25th Jan 2010 22:40
I was also saving as a mesh but maybe the problem was that I didnt use dbSetObjectEmissive.

But its working perfect now

Very nice

Now I need to take vacation from my job and sent my wife on a 4-week holiday... so I can play with these

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 25th Jan 2010 23:05
I only use the dbSetObjectEmissive to color the objects white, because their default color is hard to see against the blue backdrop.

Haha, they are quite fun once you get into them

Login to post a reply

Server time is: 2024-11-20 05:32:22
Your offset time is: 2024-11-20 05:32:22