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.

Newcomers DBPro Corner / animations, 3d models, terrain - possibillities

Author
Message
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 17th Aug 2008 20:07 Edited at: 28th Aug 2008 23:28
Hi all, I have few short questions...



And the second question: Is it possible to make the terrain as 3d model in 3d max and import it to the game, then making the characters walking on it's surface? I would prefere rather NOT to use any type of collision, I think that would make a lot of bugs like, random falling through the terrain... I'd be better to set up something like characterZposition=TheHeightOfTerrainHesStandingOn+characters_height

would it be possible to get the "height of therrain hes standing on" from a 3d model?

It would be simple if the terrain was all flat, the THOTHSO variable would be constant... but if I'd make hills etc?

Thank you for your time
I hope to make a good game some day, but I have to learn like, soo much, yet
Sonic 91 Software
19
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 17th Aug 2008 20:49 Edited at: 17th Aug 2008 20:50
Quote: "would it be possible to get the "height of therrain hes standing on" from a 3d model?

It would be simple if the terrain was all flat, the THOTHSO variable would be constant... but if I'd make hills etc?"


I don't know about the rest of your queries, but to make a character walk up and down hills on a terrain, use the "get ground height" command and put it in your main loop as the "y" position of your player object, i.e.



Fight the good fight of faith,
Lay hold on Eternal Life.
-1 Timothy 6:12-
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 17th Aug 2008 21:12
Using matrix is not what I ment
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 18th Aug 2008 10:21
Quote: "would it be possible to get the "height of therrain hes standing on" from a 3d model?

It would be simple if the terrain was all flat, the THOTHSO variable would be constant... but if I'd make hills etc?"


Yes, using Sparky's collision dll it's easy. Just cast a ray from the waist of your character down to just below it's feet then using the command "sc_getstaticcollisiony()" you can get the correct height of the ground. I would post a demo showing how it works but you probably don't have Sparky's right now anyway and it's late here.

Here is a link to the topic on Sparky's: http://forum.thegamecreators.com/?m=forum_view&b=5&t=74762&p=0


I'm Pro grammer.
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 18th Aug 2008 19:24 Edited at: 28th Aug 2008 23:26
great! thank you
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 28th Aug 2008 23:25 Edited at: 29th Aug 2008 14:00
Quote: "es, using Sparky's collision dll it's easy. Just cast a ray from the waist of your character down to just below it's feet then using the command "sc_getstaticcollisiony()" you can get the correct height of the ground. I would post a demo showing how it works but you probably don't have Sparky's right now anyway and it's late here.

Here is a link to the topic on Sparky's: http://forum.thegamecreators.com/?m=forum_view&b=5&t=74762&p=0"


So, I downloaded the plugin and saw that it is indeed great, tried to experiment, and - that's weird.

When I create a simple code like that...

It works for the box created earlier, and prints the object number when I'm above it. Perfect. BUT, when I replace it by getterrainheight() and make a function:


It always prints 0.....

Any idea why is this happening?

I tried this for imported .X model too, and it always prints 0 no matter if it's function or not when I use ComplexObject. Why?

edit: I ran some tests, still can't get ComplexObject collision working



I guess it's not the lucky day.
HWT
19
Years of Service
User Offline
Joined: 1st Apr 2005
Location: Earth
Posted: 7th Sep 2008 00:49 Edited at: 7th Sep 2008 01:15
Try this:


The problem is that functions have private variables (variables inside a function cannot be read/edited from outside the function).

Therefore, instead of CamXPos# variables, I just use Camera Position functions. And you'll notice the
bit with the added "collide" at the end. This way, when you call the function it will return the "collide" variable as the result.

"Returning" values means "giving the final result of the calculation", kinda like how the DBP command Camera Position X() "returns" the camera's x position when called.

Now, you don't need to print the collide variable; instead use:


If you don't understand, post back and I'll try to explain better.

Hello world tommorrow
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 7th Sep 2008 01:27
Hallo friends ...if you want to load your own 3D object as a terrain, and you want to guess the height of any point on your 3D land, you could use as well the INTERSECT command.

I send you an example. cheers

oh my god

Attachments

Login to view attachments
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 7th Sep 2008 14:02
HWT, that was indeed the problem.
But I can't still use ComplexObject, for it will return 0. Therefore I decided to 'slice'the terrain into lots of smaller parts and set them up as normal objects (not complex), and it works..
HWT
19
Years of Service
User Offline
Joined: 1st Apr 2005
Location: Earth
Posted: 7th Sep 2008 15:32
Hm... strange... could you post the values you used for ComplexObject

Hello world tommorrow
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 7th Sep 2008 15:46 Edited at: 7th Sep 2008 15:46
SC_setupComplexObject 2 , 1 , 2
or
SC_setupComplexObject 2 , 0 , 2
or
SC_setupComplexObject 2 , 0 , anything

not working

SC_setupObject 2 , 0 , 0

working
HWT
19
Years of Service
User Offline
Joined: 1st Apr 2005
Location: Earth
Posted: 7th Sep 2008 17:47
That's because you are putting the object into group 1 - check the help files.

The values for the SC_setupComplexObject command go like this: "Object Num, group Num, Faces per node"

Try: SC_setupComplexObject 2,0,2 for the complete terrain object that you used at the start.

Hello world tommorrow

Login to post a reply

Server time is: 2024-11-25 18:30:40
Your offset time is: 2024-11-25 18:30:40