camera curve follow

(8 posts) (2 voices)

Tags:

No tags yet.

  1. robertor

    veteran
    Joined: May '13
    Posts: 255

    Hi there,
    I've crated a curve and I want a camera follow this curve looking at a specific object. In the project I've attached I've the camera goes follow the curve but it looses it's up direction.
    Does any1 know the reason of this?
    Thanks

    Attachments

    1. test_curve.zip (89.6 KB, 8 downloads) 1 year old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 1 year ago #
  2. iainB85

    Interplanetary Delivery Boy
    Joined: Jun '08
    Posts: 515

    Best Answer

    I updated your project with a few changes:

    1) I am not sure what is going on with that curve follow BB in terms of orientation, but I recommend to use the curve progression BB instead, as it splits its output into position and direction, it's more easy to work with

    2) I get the orientation of the camera, then set the orientation using it's current direction, but forcing it's up to be 0,1,0 -- this ensures that your camera will never become "tilted"

    Hope this works for you.

    Attachments

    1. test_curve.zip (90.1 KB, 29 downloads) 1 year old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 1 year ago #
  3. robertor

    veteran
    Joined: May '13
    Posts: 255

    Thank man!
    You're great

    Posted 1 year ago #
  4. robertor

    veteran
    Joined: May '13
    Posts: 255

    Hi Ian,
    a drastic up to this post because I was wondering how to do the same in VSL. Any Idea?

    Posted 9 months ago #
  5. iainB85

    Interplanetary Delivery Boy
    Joined: Jun '08
    Posts: 515

    Well... those building blocks were created specifically to make following a curve easier. I would recommend you do it in a schematic task... but it's certainly possible in VSL still, just a lot more complicated because you don't have the "Curve Progression" building block, so you'd have to get all the control points of the curve, put them in an array, and manually set the orientation / movement of your object based on those.

    Is there any reason you'd want to do this particular task in VSL instead?

    Posted 9 months ago #
  6. robertor

    veteran
    Joined: May '13
    Posts: 255

    well,
    the reason is that I'm just few commands (or I think "few command") to the solution.
    e.g.

    ...
    if (e.leftButton){
    myView.SetCamera(focusCam);
    auxpoint.new(1);
    focusCam.GetPositionInSpace(auxVec,NULL);
    auxpoint.Position.Set(auxVec.x,auxVec.y,auxVec.z);
    myCurve.AddControlPoint(auxpoint);
    auxpoint.new(1);
    reference.GetPositionInSpace(auxVec,NULL);
    auxpoint.Position.Set(auxVec.x,auxVec.y,auxVec.z);
    myCurve.AddControlPoint(auxpoint);

    /*******command to follow a path :-)******/
    }
    ...

    I think to implement a schematic task or function with the task you gave me many months ago.
    Thanks anyway

    Posted 9 months ago #
  7. robertor

    veteran
    Joined: May '13
    Posts: 255

    Hi Ian,
    after the code I've wrritten 3 days ago I've added the following line

    GetTask("moveIn_curve").Start();

    that links to a task composed as in the image attached.
    Tha camera moves smoothly on the curve but when it reaches the end poi it seems that the FOV disappear and I just seee a grey screen....
    why is this happening?

    Attachments

    1. graph.jpg (66.8 KB, 3 downloads) 9 months old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 9 months ago #
  8. robertor

    veteran
    Joined: May '13
    Posts: 255

    Ok... solved!
    I've set the lookat value and the ending point of the curve to the same object so the FOV went in a mess!

    Posted 9 months ago #

Reply

You must log in to post.