#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0

    Ruby scripting a movement in engine


    y
    Hello

    Im a ruby beginner.And I am trying to animate something in a simple 3d engine which has a ruby binding available.So
    you can utilize some loaded models in the engine to move, blink etc.I ve managed to blink,to rotate and to move a
    loaded model.The scene you will see is basicaly a globe model with the texture of the sky on it in the middle is a ground model with a grass texture.There is a road juncion model and a car on the road.I m asking for help or litle guidance because Im stuck in this one.Basicaly I m trying to create a turning movement (method) for an object(car or anything else).{A very basic

    movement with no physics involved) .To be able to take a turn on a junction for example in any way.

    If I send you the

    basic engine and my scripts along with the models could you please help me with this? I am not or maybe the

    philosophy behind of the programming of this kind of a movement.AS I uderstand you are creating scripts in Ruby

    for Google Sketchup.So maybe you can help me in this.

    #####The files####

    You can run my basic script with the start.bat. The models and the configuration files are in DATA and DATA\Vila directory there is also the *rb fle which creates the whole scene.

    there is a simple blinking script and a simple movemetn script aslo a rotation script. But Im not able to do a

    movement along a curve.MAybe a bazier curve or something with that? hoping for help.


    files awailable for download

    "put zshare site name here"/download/73810106b9303da5/

    "put megaupload site name here"/?d=G0ZVI4KU

    "put rapidsahre site name here"/files/364471302/enginescriptmodels.zip.html


    "put deposit files site name here"/files/3s62cdaka


    have a nice day

    NeoNF
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    Constant Limbo
    Posts
    989
    Rep Power
    363
    This is not a factory; we do not churn out solutions to compensate for your lack of effort. Should you insist on treating this like a factory you will have to offer up compensation to the employees.
    True happiness is not getting what you want, it's wanting what you've already got.

    My Blog
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0
    Originally Posted by L7Sqr
    This is not a factory; we do not churn out solutions to compensate for your lack of effort. Should you insist on treating this like a factory you will have to offer up compensation to the employees.

    Hi I am not treating you as a factory.Askling for direction help, toughts way of approach.I ve uploaded the files.There are the script and methodts I ve already done.I did not postet code samples because it has some specifics.You need to see the script file to understand that.

    I ve managed to make a turning movement with the combination of a movemetnt forward and rotation but it looks very ugly I ve combined 3 movement(move forward) sequentions with changet parameters + rotatation and the whle turning action consumed 3 steps and looks pretty ugly I would send the code but to see the result you need to paste into the script and start up my scene. IF you really need to see a bit of code as equivalence of effort here it is.

    Code:
    if ($scene_id==0) then 
    
      if(MoveObject1($auto1,0,-1,0,6)) then $scene_count=0;      $scene_id=1;    
    end 
    end
    
      if ($scene_id==1) then  if(CameraDirection($auto1,1,1,-25,30))||(MoveObject2($auto1,-0.4,-0.35,0,6)) then $scene_count=0;      $scene_id=2;  
      end
    end
    i
    f ($scene_id==2) then   
    
     if(CameraDirection($auto1,1,1,0,1))||(MoveObject2($auto1,-1,0,0,2)) then $scene_count=0;      $scene_id=3;   
    
    end 
    
    end


    MoveObject = moves object in given direction
    CameraDirection = is for camera orientation but it can be aplied on any object (model) in the engine.

    and scene Id is self explanatory if scene 1 is done skip to scene 2 etc....


    But as I ve mantioned IT is not the best solution SO I am asking for help.

IMN logo majestic logo threadwatch logo seochat tools logo