Placing An Object On Another

Blitz3D Forums/Blitz3D Beginners Area/Placing An Object On Another

Maximus Primal(Posted 2005) [#1]
I am VERY new to Blitz (only got it last night!), playing with it at the moment to try and make something usefull for what I want to do later.

My question is this, is there an easy way of getting one object/mesh/entitiy to sit on another which is uneven, i.e a car on a hilly road.

I know the driver example included with Blitz3D does it for a terrain, but does the same principle apply objects/entities?

I have models ready to go and got them in place, just want to know where to look (or roughly) how to do this.

Any help is appreicated.

Max


Stevie G(Posted 2005) [#2]
No reason why you can't use the driver method on normal meshes. As long as you assign an entitytype and set up the collisions properly it will work.

An alternative .. should you want the car to hug the track is using a linepick straight down and using aligntovector command on the Y-axis using the vectors returned from PickedNx, Ny, Nz ..

A more advanced alternative is using Verlet integration. While complex to understand it does produce very realistic collisions and movement although requires alot of tinkering to get cars working right. I only recently acheived this after 10 rewrittes of code over a couple of months!!


Sledge(Posted 2005) [#3]
Useful aligning example here.


Maximus Primal(Posted 2005) [#4]
Thanks guys, I appreicate the thoughts and code. I thought the same principles used in the driver demo would apply but I wanted to be sure first before I started off doing something and getting hopelessly lost! :-)

I will take a good look at both the code suggested and the driver demo tomorrow and see if I can get something hashed together (which I am confident I can). At least I will know that I am looking in the right direction and have a good chance of writing something that should do the job (if not perfectly),

Just looked up "Verlet integration" and that is WAAAAAYYYYY beyond me! I think for now I will stick with what I have.


Thanks again. I really do appreicate it.

Max


Caff(Posted 2005) [#5]
Yeah, verlets are tricky stuff. There's been some good demos using it though. A slightly better route might be to use ODE, a physics engine. This will allow you to handle collisions responsively (ie. if you drive into another car, the impact will look realistic).

However ODE is tricky to get right - to get a decent 'feel' for the car you will need to really play around with the variables.

Have a look at the demo of ODE here - try the car demo and see what can be done with a bit of work.