The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

1. ## Curves race cars

Hi Folks,

http://www.kirupa.com/developer/acti...ape_camera.htm

In the example of race car we have a road generated by tires in line to the infinity. My Cuestions is " How I can simulate a curves with these tires??"

Thanks!!

2. 371
posts
Hungry Member
in that example making curves would look illogical because the tires are reused (when they are not visible they go back to the start) but to develop ur own code u could use math cuadratic equations or sine/cosine to make curves

3. Thanks for answer, This is my code:

//DATES:
//The movie = 18 fps
//Curve = 600 m
//start curve = 50 m form start race

//ESPACE
//Resolve the velocity and space
distancia = function () {

};

// TIRES
displayTire = function () {
var x = this.x-cameraView.x;
var y = this.y-cameraView.y;
var z = this.z-cameraView.z;
if (z<0) {
this.z += 3000;
z = this.z-cameraView.z;
}
var scaleRatio = focalLength/(focalLength+z);
if (espacio>50 && espacio<650) {
if (espacio>50 && espacio<349) {
}
if (espacio>349 && espacio<650) {
trace(espacio);
}
} else {
this._x = this.x*scaleRatio;
}
// this._x = x * scaleRatio;
this._y = y*scaleRatio;
this._xscale = this._yscale=100*scaleRatio;
this.swapDepths(Math.round(-z));
};

Any suggestion???

Si tienes dudas hablo espaņol de PM.
Gracias.

4. you can also read some more of the tut. he tells how to make rotation.
3D is not simple you can't just ctrl+c it, you have to onderstand it