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 / Help Camera/Object

Author
Message
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 1st May 2008 22:31
Hey, everyone. After getting an object to load for a scene of mine, I've been trying to add a camera and getting it to be effected by the hight of the object as I walk on top of it. Or move the camera on top it.
Here is the code I have for it.


I believe I might have to load it as terrain, but I'm very new to this so I wanted to see if there was another way to do it.
Thanks for your time!
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 2nd May 2008 00:50
Are you saying you want to add something similar to gravity? So that the camera does not "float" in midair? I'm pretty sure the terrain tutorial included with DGDK covered this...

~~It's not who you are underneath, but what you do that defines you.~~
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 2nd May 2008 00:59 Edited at: 2nd May 2008 01:00
It did, but that was for a terrain command. I want to know if I can do this with just dbLoadObject. I know it was in the tut, but I just wanted to know if I can do it with this command instead of terrain.

I'm sorry if this seems like a dumb question, but I'm new to this. =]
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 2nd May 2008 01:12
I haven't really experimented with terrain as there is no need for it in my game currently so I'm not sure what you could do... You could try loading it as terrain OR do some complex collision detection of your own...

Maybe someone else has a better idea, wait for their reply...

~~It's not who you are underneath, but what you do that defines you.~~
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 2nd May 2008 03:02 Edited at: 2nd May 2008 03:02
Thanks for your input, man. I'll fool around with it to see what I can do, but like I said I'm new to this. I'm more of a 3D artist. I have a game idea that I want to make, but the guy that was supose to do my programming just said I think I'll take care of the business side of your game. I'm like...Uhh.. No. haha. Anyways, I'm on my own on this one for the most part. But yeah. Thanks dude.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 2nd May 2008 04:47
Man, I didn't even help you at all... There is absolutely no need for thanks, especially the amount you're giving, I just wish your project well... Have Fun!

~~It's not who you are underneath, but what you do that defines you.~~
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 2nd May 2008 06:11 Edited at: 2nd May 2008 06:15
Thanks on the good luck, man.

Okay, can any one at least point me off in a good direction to constraints or something? So far looking at terrain you can only load it as a .DBT file, and when ever I try to load it as anything else I get a bunch of error messages about created a bitmap. Sooo from the looks of it constraints are the way to go. I guess I've done okay work so far for a beginner, but any help would be awesome.

Edit:
Ahh, looking through the Syntax information thing I see there collisions. So any one wanting to answer this will have my utmost respect.

void dbSetBspObjectCollision ( int CollisionIndex, int ObjectNumber, float Radius, int Response )

I know void means place it in the void or man command...well what does the rest mean. I know Object Number, but the rest I have no clue. Like collision index, float radius and response.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 2nd May 2008 06:23
.DBT? Never heard of that format... DGDK supports the following 3d formats: 3DS, X, DBO, MD2, MD3 and MDL... BTW I'm NOT AT ALL an expert... I know nothing about constraints other than that it is a programming paradigm... If you want to load custom 3D formats there is a nice tut here, although it's not very simple... http://forum.thegamecreators.com/?m=forum_view&t=123392&b=22...

I'm sorry if that's not what you're trying to accomplish... If it is then you can try that tut...

~~It's not who you are underneath, but what you do that defines you.~~
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 2nd May 2008 06:52
I've been meaning to look into that thread. Well, if I don't figure it out this weekend I might post another help thread on how to get the camera to react to the object, or to even get the terrain to load. =\ so many problems! Haha, all in good fun though.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 2nd May 2008 06:59
If/Then statements are your friends, my friend... well... I dunno... They're what my game is built upon anyway LOL...

What do you mean by getting the camera the camera to "react" to an object? Do you mean like if someone punches the camera it breaks... LOL...

Simply just say:
if (someone punches camera) {have the camera grow arms and hands and punch the guy back;}
Of course it won't be that simple but that would be basically how "I" would do it anyways...

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd May 2008 16:47
Oh, Pyrro... you just trying to make it so you can traverse the terrain?

I'm a little confused, but your original post in this thread seems fairly easy to do.

Many ways to do it though. Is this your Goal: Make app able to load a terrain, and then walkaround ON the terrain.???

If so... MANY of us can help. To get your mind going as Core2uu alluded, you have a few "Terrain" formats to choose from. Mesh, Native GDK Matrix, and "GDK Terrain". All have pro's and con's, limits and strengths. All BASICALLY work the same way. You adjust camera to Ground Height, and GDK Native Terrain and GDK Native Matrix have builtin ground height functions to help. Dynamic Mesh, you need to write your own Ground Height function and there is more than one way to do that as well. One using Arctanful I THINK and the vertice height, and the cheaper way I usually do.. is either GDK Native collision vis Intersect Object or Sparky's GDK dll - and perform a raycast (bit more set up but a great library for collision)

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 2nd May 2008 22:19
Quote: "Many ways to do it though. Is this your Goal: Make app able to load a terrain, and then walkaround ON the terrain.???"


Yes, thats exactly the way I want to do it. If you wouldn't mind, could you post an example of the best way to do it, or maybe the most effective?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd May 2008 22:40
Ok.. Pick a terrain format... I recommend Native GDK Terrain (Its like DBPro Advanced Terrain) It has its pro's and cons but is a GREAT place to start (And stay actually if you are satisfied with appearance etc.) ... (Hint.. if you look in DarkGDK - I'm PRETTY SURE there might be a terrain demo, and once you get the terrain loaded, they basically just move camera with keypresses, but change the camera "Y" to the Ground Height. Note.. the move camera using arrow keys... um... JUNK!!!!! (It fights you to much and that alone could be baffling you)

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 2nd May 2008 22:52
I'm a little confused. DBPro Advanced Terrain? Is this DarkGDK pro or something? There is a terrain demo/tut, but the problem is I'm not sure exactly how to code it, really.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd May 2008 22:57 Edited at: 2nd May 2008 22:59
Sorry... let me confuse you not LOL

DarkBasic Pro is another product from TGC. This product has a Native "Terrain" system. It's kinda lame and buggy I guess.... because it was replaced by a PAY-FOR addon - eventually made free coined "Advanced Terrain".

This "Advanced Terrain" SEEMS to be the Same Terrain System that is the NATIVE DARK GDK TERRAIN System. <long inhale> That help with the confusion?

DarkGDK's Native "Terrain" "System" is (seems like anyways) the same "System" in "DBPro's Advanced Terrain".

This is fairly easy to use, handles frustrum culling for you (makes it run faster... not so bad at easting Frame rates), and has the built in groundheight function! TA DA

[edit]Um can someone point him to a simple DarkGDK Terrain demo?[/edit]

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 2nd May 2008 23:04
Thanks, that helps the confusin a bit.

I have the terrain files, and demo/tut files. The thing is, I want to load the terrain as a .X file, basically like an object, but it doesn't seem to like this idea.



Thats what I'm working with...can it be done this way? When ever I build it, it says I have three errors.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd May 2008 23:17
No it doesn't. The Terrain System works on:

1 Height Map file (needs to be like 256x256, or 512x512, or 1024x1024 or (kinda huge) 2048x2048...

1 Texture file for the "Ground"

1 Texture file for the "Detail" that is repeated across the terrain and gives a nice "rough ground" look... usually a grayscale LOOKING 24bit bitmap file... I think PNG format works too...

What YOU WANT to do it DROP ALL the terrain commands, load the "Object" as an OBJECT. THEN... You use can use the native GDK intersect object to make your own ground height function.....

Whether you use sparky's raycasting, now even Tobi's Collision, or the native Intersect Object.. the theory for getting a ground height is the Same.

Wherever you want to check the groundheight... in your case.. whereever the camera is... you plot an imaginary "Laser" or "RayCast" from somewhere directly over the camera... higher then the highest point.... and shoot that laser STRAIGHT DOWN lower than the LOWEST point of the terrain.

You use numbers you know so you can do some math...

...let me see if I have some intersect code lying around for a ground height function....hmm....humm...... Ok found something



Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 2nd May 2008 23:24
Okay. I'll go get that Terrain program/plug in and I'll see what I can do. I'll post back here on my failure or success. =p
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd May 2008 23:33
NO NO....

NO PLUGIN

DarkGDK doesn't need a plug in!.... unless you mean sparkys ...oops

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 2nd May 2008 23:51
AHHH!! haha. im so confused. haha.

Okay, lets hit this from the basics. I want to create an environment to "walk on". I have a .x file that I want to use. Exactly what code do I need to use? Looking in the GDK information dialog under terrain I see a bunch of commands but no idea how to use them. What do I need to do to at least load it? Thanks for your patience everyone.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd May 2008 23:53
You have Direct X object - So just LOAD IT! (Do NOT USE TERRAIN Commands for this type of file!) LOL

See ya - time to drive..... be online later

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 3rd May 2008 00:06
I am loading it...but I want to have the object effect the camera as I move it with the WASD keys. I already have that set up, and I'll eventually move that over to a joystick or something. ALL I need is to know how I make the camera move up and down as if it was in the eyes of a person. Example. When I cross a small bridge I have set up thats curved, the camera will move up slowly and then move down slowly as I walk across.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 3rd May 2008 04:14
So you want to calculate ground height AND make the camera simulate bipedalism?

For ground height just use Jason's snippet or Sparky's DLL...

For making the camera "bob" you have to record a height and set a boolean to true which true moves the camera up until you hit the high point then falsify the bool and "trueify" another bool that makes it go down... When you reach the low point falsify that bool and reinstate the other one... Then it keeps on looping and you have a bipedalist simulation...

~~It's not who you are underneath, but what you do that defines you.~~
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 3rd May 2008 19:07
Gah! I feel uber stupid. haha.
Here is where I put it.



It says I have 2 errors. Any suggestions?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd May 2008 19:58


There.... un comment the "dbRotateObject" line because I didn't need it. Have fun!

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 3rd May 2008 22:15
thanks dude! Sorry for my lack of understanding. I'm still in high school, but I want to get ahead so when I head off to Devry I'll be one of the tops in my class. A lot of work, but I hope it'll be worth it.

Thanks again!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd May 2008 22:26
You're Welcome... so is it safe to say the code I gave you is working ok?

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 3rd May 2008 23:07
Yeah, its working. All I want to do now, really, is too make the camera "float" a little higher off the ground, but still have the exact same effect. This way it looks like im not 2' tall. haha.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd May 2008 23:43


See that line? (Near end of your loop)

The Number 10 is how high ABOVE the "returned" Ground Height!

Change it to 20, or 80, or... you get the idea

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 4th May 2008 00:14
I looked at that, but didn't change it worrying i would screw something up. Okay, time to try and learn what all it means.
This is goin along great!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 4th May 2008 01:22
Make a back up - THEN screw it up all you want - it really is the best way to learn. You will also be surprised how far the undo works in VS2008 LOL (Which is a GOOD THING! Saved me a couple times)

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 4th May 2008 02:15
Haha, I will. I noticed the undo goes a faaaaar way. Saved me too. haha
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 4th May 2008 03:04
Quote: "I noticed the undo goes a faaaaar way."

Certainly goes farther than Paint...

~~It's not who you are underneath, but what you do that defines you.~~
Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 4th May 2008 06:16
Quote: "Certainly goes farther than Paint... "


Haha, true that man. I work in 3D Studio Max a lot, I had to go into the preferences and I added about 500 undoes to the system. I use it....a lot! haha.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 4th May 2008 07:53
If only it was that easy in reality... But then again I've seen too many cartoons that have a moral of time machines are dangerous, better to go with the flow than try to undo and mess up again, worse...

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 4th May 2008 19:48
Unless you can get rich first... then find a place in time where you can live out your life without feeling the consequences Say... Give Guns to the Maya's in trade for Gold.... Then Move to Hawaii and Retire! LOL

Pyrro
16
Years of Service
User Offline
Joined: 23rd Apr 2008
Location:
Posted: 4th May 2008 20:38
Oh believe me, Sage. I would if I could grasp Maya. I have the learners edition on my computer and I just find it a little too difficult in my case. I will work on it, but I doubt I'll ever understand it the way I understand Max. Plus, I want to get into making a game Dev, which Max is over all a more preferred base for game making. Maya, can still do some wicked stuff in game dev areas. I.E Resistance Fall Of Man.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 4th May 2008 20:40
Quote: "Unless you can get rich first..."


If only THAT was easy in reality... I think that's why people play video games... They can experience things they wish they could in life but can't... If you have ever read The Reality Bug in the Pendragon novel series you'll know what I'm talking about... (Wow, we're off-topic)...

~~It's not who you are underneath, but what you do that defines you.~~

Login to post a reply

Server time is: 2024-11-20 09:27:45
Your offset time is: 2024-11-20 09:27:45