Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Normals question
Topic Started: Feb 25 2009, 01:20 AM (822 Views)
saijee
Elite Member
[ *  *  *  * ]
Wow this is beautiful.

I'd need to mess around with it a bit though.

Thanks a lot really.

But what I'd really really would like to do is make it to where instead of Locking on to the path and finding the closest way to it, just make the movement go in relation to the path, as my game has some free roam aspects to it.

Such like in this video:
http://www.youtube.com/watch?v=SWpv5s07UqQ&feature=related

I might be able to figure out how to do this on my own though. Thank's again.
Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
saijee
Mar 8 2009, 01:52 AM
Wow this is beautiful.
Thank you - and it has become even more beautiful ^_^ .

First, please download the updated example (yes, I've improved it even further). Both MoveToWaypoint(...) and MoveAlongCurve(...) have changed, so you need to re-import those.

saijee
Mar 8 2009, 01:52 AM
But what I'd really really would like to do is make it to where instead of Locking on to the path and finding the closest way to it, just make the movement go in relation to the path, as my game has some free roam aspects to it.
And now for the really good news: download this application of the example, which does exactly what you want :) .
Use the arrow keys to move good ol' Mr. Blocky, who once again saved the day :D . As you can see, you can move him around freely, while still being bound to the path.

So how does this work? The player character controls the movement of another object, which is strictly tied to the curve. The speed of this "path guide" depends on the speed and rotation angle of the player, but also on the curvature of the current path segment. At the same time, the movement of the player is relative to this path guide, so both objects influence each other. Finally, the camera follows the path guide, so you always have a very fluid camera motion, with the view centred on the path.

The main key to the solution, is that the transformation of the player (relative to the guide) is turned into a matrix, which is then transformed with the built-in matrix of the guide. This allows you to do just about anything you want with the player character, while still keeping it connected to the path.

Note also, that this method makes it very easy to keep the player at the desired distance from the curve; you simply have to restrict the (relative) x-movement to the values you want (see the MovePlayerChar() script).
So this actually makes it possible to keep the player from leaving the path area without having to use any form of collision handling.

And don't forget that you can disconnect the player from the path completely, by calling MovePlayerChar() only when he should actually follow a path, depending on the area he's in.

It's become a little more complex, but this is really the best I can do, so I hope it will solve all these problems.
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
ZetaBoards - Free Forum Hosting
Free Forums. Reliable service with over 8 years of experience.
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply