Game Development Community

making an object follow the contour of the terrian?

by Robert Grant · in Torque Game Engine · 11/29/2009 (11:29 am) · 9 replies

how would you make an object follow the contour of the terrian?

#1
11/29/2009 (12:42 pm)
I've never moved an object that wasn't a character or a vehicle. I'd start with looking at how characters are set up, and then run the object like an AI, that is assuming you are creating a path for it to follow, it should collide with the ground if set up properly.
#2
11/29/2009 (1:00 pm)
Why can't normal objects follow a path? They can in TGB...
#3
11/29/2009 (6:12 pm)
the object is actually stationary.

i'm wondering how to make it wrap to the terrian.

take an orange for example

if the object was my hand and the orange was the terrian if i grabbed it my hand would follow the shape of the orange wrapping it.

what i would like to do is put an object on the terrian and the object would mold to the terrian.

#4
11/29/2009 (10:23 pm)
Oh, well think of an object as a piece of paper, if i lay a piece of paper ontop of a ball it doesn't automatically conform to it's shape, i have to physically mold it around it. Models/dts objects are kind of like that piece of paper, they can only do what you "program" or mold them to do.

What you're talking about is a pretty intense physics implementation. Unless i'm understanding you wrong, which may be the case.

How much of the terrain are you wanting to cover, what is said object that you want to cover the terrain?
#5
11/29/2009 (10:54 pm)
what ive got is a script written to spawn grass

everything is working as intended except that the object is a flat plane that stays on the same Z position as the previous section of grass

when it gets to an area with higher Z elevation it goes into the elevated area

i would like to get it to spawn across the terrian, molding to the elevations in the ground
#6
11/30/2009 (3:00 am)
Ah ok, I believe I understand now.

May I ask if this is the code that you are using?
www.garagegames.com/community/resources/view/4550

Or if you are using something that you have scripted yourself.
#7
11/30/2009 (12:29 pm)
its a cs file i wrote in script
#8
11/30/2009 (7:08 pm)
Have you tried breaking the grass plane into smaller pieces? and are you setting the Z-level in script as well, or is it dynamically finding the ground at the player's feet?
#9
11/30/2009 (11:31 pm)
i did a few runs with some smaller objects but the effect wasnt quite the same, they were disappearing from render quickly too.

not sure if it was the game engine doing that or not but it was related to the size of the objects for sure.

at the moment im using the Z from %obj so whatever Z the %obj was on is what it stays at.