Results 1 to 4 of 4

Thread: Curves race cars

  1. #1

    Curves race cars

    Hi Folks,

    In this page
    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??"

    Help me, please.

    Thanks!!

  2. #2
    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. #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 () {


    velocidad = Math.round((cameraView.velocity)/(3.6*18));
    espacio += velocidad;


    };


    // TIRES
    var radio = 0;
    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) {
    radio = ((espacio)-50)/(300*0.0222);
    this._x = this.x*scaleRatio+(0.05*z+scaleRatio)*radio/50*+1;
    }
    if (espacio>349 && espacio<650) {
    radio2 = (650-espacio)/(300*0.0222);
    this._x = this.x*scaleRatio+(0.05*z+scaleRatio)*radio2/50*+1;
    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. #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

    .....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012