Rotation between two vectors

Hello,
I am looking for a way for my 3D character to slowly rotate
between two vectors. The rotation vectors is results from the
rotation property of GetWorldTransform().
My first idea was to somehow convert the two vectors into
degrees and with the help with that information then simple use the
rotation()-function.
All help to figure out how to do so, or other suggestions,
would be highly appreciated. Thanks. :)
Thanks!

The interpolate() and interpolateTo() commands accept a
percentage value as the second parameter, so you should be able to
specify what percentage of the interpolation you want, at the
current point in time, as a factor of your time delta.
- Ben

Similar Messages

  • Find difference between two vectors ?

    Hi,
    I have two vectors, the first contains:
    v1.add("1");
    v1.add("2");
    the second:
    v2.add("1");
    Now I want to print out the difference between both.
    Does anybody have en idea ?
    Regards
    Micha

    Yep, that should definitely do it. I think the point ssav is trying to make is that to solve this problem we need to know your actual requirements. "the difference between" is too vague. Here are some things to think about:
    - Is position important? That is, is a List containing 1 and 2 the same as a List containing 2 and 1 or different?
    - If List A contains 1,2,4,5,6 and List B contains 1,2,3,4,5,6 what would you want to see?
    - What if List A contains 1,2,3 and List B 1,2,2,3?
    - What if List A contains 1,2,3 and Lits B 1,2,and a java.lang.NullPointerException?
    You're probably starting to see that this is not as simple as you thought. Come back with more specific requirements and you may get better help.

  • Force required between two vectors

    Hi, just a quick problem. I have two 'players' on a pitch. And need to work out how much force is required to move a ball between the two players. They are both represented as vectors. Any ideas? dot product?
    Thanks,

    It's the inverse square of the negative square root of the hypotenuse of the opposing vectors inside leg, over the sum of the square of E or A on X such that X is equally distributed amongst all players on the bottom peg.
    Obvious!

  • Does rotation matrix keeps perpendicularity of two vectors?

    I know my question is quite silly but let me explain my problem...
    During the execution of my program, I wrote my own "lookAt" function wich takes into parameters two 3D points (eye position and view position) and a up vector. Everything is working great but, at one time, when I need to rotate my whole thing, I get a strange mistake I don't know how to solve :
    I compute my two vectors (up vector and the view one (view - eye)), there I check this two vectors are perpendicular (v1.dot(v2) == 0). Then I multiply my two vectors by my rotation matrix and I get my two new vectors. But, when I check if the two vectors are perpendicular, v1.dot(v2) now equals to something like -x.xxxxxxxxxxxxxxxE-XX, XX like 16 or 17. I know the problem is coming from the precision of my numbers, but does someone knows how I can solve it to conserve the perpendicularity?
    I really need this perpendicularity because I need to compute a new transform Matrix and with my problem, this one is not congruent, so I get an error.
    Thanks!!

    i did the same and had an error too, post you calculation code and i will try to help if i can

  • Trendline between two points

    hi
    i have a code like this
    trendline.jsp
    <%@page import="ChartDirector.*" %>
    <%
    // The data for the line chart
    double[] data = {50, 55, 47, 34, 42, 49, 63, 62, 73, 59, 56, 50, 64, 60, 67, 67, 58,
        59, 73, 77, 84, 82, 80, 91};
    // The labels for the line chart
    String[] labels = {"Jan 2000", "Feb 2000", "Mar 2000", "Apr 2000", "May 2000",
        "Jun 2000", "Jul 2000", "Aug 2000", "Sep 2000", "Oct 2000", "Nov 2000",
        "Dec 2000", "Jan 2001", "Feb 2001", "Mar 2001", "Apr 2001", "May 2001",
        "Jun 2001", "Jul 2001", "Aug 2001", "Sep 2001", "Oct 2001", "Nov 2001",
        "Dec 2001"};
    // Create a XYChart object of size 500 x 320 pixels, with a pale purpule (0xffccff)
    // background, a black border, and 1 pixel 3D border effect.
    XYChart c = new XYChart(500, 320, 0xffccff, 0x000000, 1);
    // Set the plotarea at (55, 45) and of size 420 x 210 pixels, with white background.
    // Turn on both horizontal and vertical grid lines with light grey color (0xc0c0c0)
    c.setPlotArea(55, 45, 420, 210, 0xffffff, -1, -1, 0xc0c0c0, -1);
    // Add a legend box at (55, 25) (top of the chart) with horizontal layout. Use 8 pts
    // Arial font. Set the background and border color to Transparent.
    c.addLegend(55, 22, false, "", 8).setBackground(Chart.Transparent);
    // Add a title box to the chart using 13 pts Times Bold Italic font. The text is
    // white (0xffffff) on a purple (0x800080) background, with a 1 pixel 3D border.
    c.addTitle("Long Term Server Load", "Times New Roman Bold Italic", 13, 0xffffff
        ).setBackground(0x800080, -1, 1);
    // Add a title to the y axis
    c.yAxis().setTitle("MBytes");
    // Set the labels on the x axis. Rotate the font by 90 degrees.
    c.xAxis().setLabels(labels).setFontAngle(90);
    // Add a line layer to the chart
    LineLayer lineLayer = c.addLineLayer();
    // Add the data to the line layer using light brown color (0xcc9966) with a 7 pixel
    // square symbol
    lineLayer.addDataSet(data, 0xcc9966, "Server Utilization").setDataSymbol(
        Chart.SquareSymbol, 7);
    // Set the line width to 2 pixels
    lineLayer.setLineWidth(2);
    // tool tip for the line layer
    lineLayer.setHTMLImageMap("", "", "title='{xLabel}: {value} MBytes'");
    // Add a trend line layer using the same data with a dark green (0x008000) color. Set
    // the line width to 2 pixels
    TrendLayer trendLayer = c.addTrendLayer(data, 0x008000, "Trend Line");
    trendLayer.setLineWidth(2);
    // tool tip for the trend layer
    trendLayer.setHTMLImageMap("", "", "title='Change rate: {slope|2} MBytes/per month'");
    // output the chart
    String chart1URL = c.makeSession(request, "chart1");
    // include tool tip for the chart
    String imageMap1 = c.getHTMLImageMap("");
    %>
    <html>
    <body topmargin="5" leftmargin="5" rightmargin="0">
    <div style="font-size:18pt; font-family:verdana; font-weight:bold">
        Trend Line Chart
    </div>
    <img src='<%=response.encodeURL("getchart.jsp?"+chart1URL)%>'
        usemap="#map1" border="0">
    <map name="map1"><%=imageMap1%></map>
    </body>
    </html>getchart.jsp
    <%@page import="ChartDirector.*" %><%
    try
         out.clear();
         GetSessionImage.getImage(request, response);
         if (Math.max(1, 2) == 2) return;
    catch (IllegalStateException e)
         response.sendRedirect(response.encodeRedirectURL(
              "getchart.chart?" + request.getQueryString()));
         return;
    %>i have to draw a trendline chart...
    i searched for examples...
    i come across this. above example..
    actually my querry is i ve to draw the trendline between two points.
    in between "data" ( 63 to 70) only...
    is there any way to do this
    please help me
    thank you in advance.

    hi
    i tried this..
    <%@page import="ChartDirector.*" %>
    <%
    // The data for the line chart
    double[] dataX0 = {6};
    double[] dataY0 = {63};
    String[] labels2 = {"Jul 2000", "Aug 2000", "Sep 2000", "Oct 2000", "Nov 2000",
        "Dec 2000"};
    // The lengths (radii) and directions (angles) of the vectors
    double[] dataR = {3};
    double[] dataA = {60};
    // The labels for the line chart
    String[] labels = {"Jan 2000", "Feb 2000", "Mar 2000", "Apr 2000", "May 2000",
        "Jun 2000", "Jul 2000", "Aug 2000", "Sep 2000", "Oct 2000", "Nov 2000",
        "Dec 2000", "Jan 2001", "Feb 2001", "Mar 2001", "Apr 2001", "May 2001",
        "Jun 2001", "Jul 2001", "Aug 2001", "Sep 2001", "Oct 2001", "Nov 2001",
        "Dec 2001"};
    // Create a XYChart object of size 500 x 320 pixels, with a pale purpule (0xffccff)
    // background, a black border, and 1 pixel 3D border effect.
    XYChart c = new XYChart(500, 320, 0xffccff, 0x000000, 1);
    // Set the plotarea at (55, 45) and of size 420 x 210 pixels, with white background.
    // Turn on both horizontal and vertical grid lines with light grey color (0xc0c0c0)
    c.setPlotArea(55, 45, 420, 210, 0xffffff, -1, -1, 0xc0c0c0, -1);
    // Add a legend box at (55, 25) (top of the chart) with horizontal layout. Use 8 pts
    // Arial font. Set the background and border color to Transparent.
    c.addLegend(55, 22, false, "", 8).setBackground(Chart.Transparent);
    // Add a title box to the chart using 13 pts Times Bold Italic font. The text is
    // white (0xffffff) on a purple (0x800080) background, with a 1 pixel 3D border.
    c.addTitle("Long Term Server Load", "Times New Roman Bold Italic", 13, 0xffffff
        ).setBackground(0x800080, -1, 1);
    // Add a title to the y axis
    c.yAxis().setTitle("MBytes");
    // Set the labels on the x axis. Rotate the font by 90 degrees.
    c.xAxis().setLabels(labels).setFontAngle(90);
    c.addVectorLayer(dataX0, dataY0, dataR, dataA,1, 0x0000cc
        ).setArrowHead(11);
    /*LineLayer layer1 = c.addLineLayer();
    //LineLayer layer1 = c.addLineLayer(dataY0, 0xff3333, "Compound AAA");
    layer1.addDataSet(dataY0, 0xff3333, "Close Loop Line").setDataSymbol( Chart.LeftTriangleSymbol, 10);
    layer1.setXData(dataX0);
    layer1.setLineWidth(2);*/
    // Add a line layer to the chart
    LineLayer lineLayer = c.addLineLayer2();
    // Add the data to the line layer using light brown color (0xcc9966) with a 7 pixel
    // square symbol
    lineLayer.addDataSet(data, 0xcc9966, "Server Utilization").setDataSymbol(
        Chart.SquareSymbol, 7);
    lineLayer.setLineWidth(2);
    // output the chart
    String chart1URL = c.makeSession(request, "chart1");
    // include tool tip for the chart
    //String imageMap1 = c.getHTMLImageMap("");
    %>
    <html>
    <body topmargin="5" leftmargin="5" rightmargin="0">
    <div style="font-size:18pt; font-family:verdana; font-weight:bold">
        Trend Line Chart
    </div>
    <img src='<%=response.encodeURL("getchart.jsp?"+chart1URL)%>'
        usemap="#map1" border="0">
    </body>
    </html>how can i set the angle of direction for the arrow..
    suppose
    i wanna draw an arrow b/w these points
    y=50 to y=37
    how can give the length and direction here
    c.addVectorLayer(dataX0, dataY0, dataR, dataA,1, 0x0000cc
        ).setArrowHead(11);i mean in daraR and dataA...
    please help me
    thank you in advance

  • Shape Tween grayed out between 2 vectors

    I have two vector graphics I imported to my stage and want to do a shape tween between them.  But shape tween is grayed out.  The images are imported Illustrator EPS's.  Why is this happening?
    I attached two screenshots.  Thx!

    Right now they are grouped, you need to break them apart. cntrl+B.
    That is going to give you some funky results though - with the "02" being the same in both keyframes and the black being what is intended to be tweened, just a heads up. You probably will just want to shape tween the black and motion tween the "02"

  • Shortest distance between two line segments

    Hi.
    I am looking for the code of the "Shortest distance between two line segments". I would appreciate if anyone has and willing to share.
    I can find some in the net but its in VB and i am not familiar with it.
    THanks a lot.
    regards,

    There are a couple of things that are not clear:
    What determines the rotation speed and lenght of each stick at any given time?
    What is the program allowed to do to prevent collision (change speed/direction, change radius, stop everything)
    Since you want to prevent collision, you need a predictive algorithm. Once they overlap, the collision has already happened. Too late!
    What information does your algorithm get (e.g. r1, r2, theta1, theta2, delta-thetat1, delta-theta2, etc.), i.e. does the program only get static information and need  to construct the trajectory from sequential history data or does it get dynamic information about speed and direction?
    The trivial answer would be to just keep r1+r2 < distance(P1,P2). This will prevent all "potential" collisions.
    LabVIEW Champion . Do more with less code and in less time .

  • How to measure distance between two points uisng uiaccelerometer

    Hello all,
    I am trying to measure distance between two points.So for that i am used uiaccelerometer but its give only rotation changes. I am moving my whole device from one point to another point so for that all x,y & z changes remain same. So how can get the device movement for that?
    Thank you..

    UIAccelerometer does not give rotation changes, it senses acceleration in each of the 3 axis in g-force units. Moving in a plane from one point to another and stopping will result in a net g-force in that axis of zero. To get distance one has to measure the initial acceleration and then the time before a deceleration is detected. It gets really complicated in real life since the start and stop are not instantaneous.

  • TS3981 After migration files are now shared between two user accounts. How can I combine them into one account?

    After migration, from PC, files are now shared between two user accounts.I have to switch users to access files. How can I combine them into one account?

    See Pondini's  Transferring files from one User Account to another, for starters

  • Using Lightroom Cloud to Sync Catalog Between Two Machines

    I have use of so many cloud services including the 20gb that Adobe gives me.  Is there a way i can sync my catalog on the cloud so that i can have all my metadata on both my laptop and desk top?  I also have 300gb of cloud storage though Copy.  I would just like some recomendations on how best to go about it. Thanks

    Hi Pat,
    Using Lightroom Cloud to Sync Catalog Between Two Machines
    If you’re running Lightroom on a laptop during your location shoots, you might want to take all the edits, keywords, metadata, and of course the photos themselves, and add them to the Lightroom catalog on your studio computer. It’s easier than it sounds: basically, you choose which catalog to export from your laptop, then you take the folder it creates over to your studio computer and import it.
    You need to decide whether you want to export a folder (all the imported photos from your shoot), or a collection (just your Picks from the shoot). In this case, we’ll go with a collection, so go to the Collections panel and click on the collection you want to merge with your main catalog back in your studio. (If you had chosen a folder, the only difference would be you’d go to the Folders panel and click on the folder from that shoot instead. Either way, all the metadata you added, and any edits you made in Lightroom, will still be transferred over to the other machine.)
    Please refer to http://www.peachpit.com/articles/article.aspx?p=1930499 for more details.
    Thanks!
    Eshant Jindal

  • Working days between two date fields and Changing Factory Calendar

    Hi,
    I have to calculate working days between two date fields excluding the weekends and public holidays for Switzerland.
    I have written the routine using factory calender and its working fine except for two problems now:
    1. If any one of the date field is empty then teh rsult should be zero.
    2. And the below code is working from 1996 but my cleints wants it to work for years before 1996 as well.
    I also tried to change the Start date in SCAL for factory calendar but it says enter values between 1995 to 2020.
    I am new to ABAP. Please help me how i can achieve these for below code.
    DATA: IT_HOLIDAYS type TABLE OF ISCAL_DAY,
          IS_HOLIDAYS TYPE ISCAL_DAY.
    DATA: T_DATE TYPE SY-DATUM,
          P_DATE TYPE SY-DATUM.
    DATA : X_DATE(4) TYPE C.
    DATA: CNT TYPE I.
    REFRESH : IT_HOLIDAYS.
    CLEAR : IT_HOLIDAYS.
    T_DATE = SOURCE_FIELDS-/BIC/ZCCCHP812.
    P_DATE = SOURCE_FIELDS-/BIC/ZCCCHP810.
    CALL FUNCTION 'HOLIDAY_GET'
    EXPORTING
    HOLIDAY_CALENDAR = 'CH'
    FACTORY_CALENDAR = 'CH'
    DATE_FROM = P_DATE
    DATE_TO   = T_DATE
    TABLES
    HOLIDAYS = IT_HOLIDAYS
    EXCEPTIONS
    FACTORY_CALENDAR_NOT_FOUND = 1
    HOLIDAY_CALENDAR_NOT_FOUND = 2
    DATE_HAS_INVALID_FORMAT = 3
    DATE_INCONSISTENCY = 4
    OTHERS = 5.
    DESCRIBE TABLE IT_HOLIDAYS LINES CNT.
    X_DATE = T_DATE - P_DATE - CNT.
    RESULT = X_DATE.
    Please help
    Regards
    Zabina
    Edited by: Syed786 on Nov 2, 2011 9:15 AM

    Hi Zabina,
    Try this function module  'DURATION_DETERMINE'.
    Give the factory calendar and unit as DAY
    With regards,
    Rajesh

  • Using A FireWire cable between two Macs and Migration Assistance to transfer all my desktop to my macbook laptop, will all my apps, bookmarks, contacts and files be transferred? I am trying to make a complete copy of my desktop to my laptop.

    Using a FireWire cable between two Macs and the Migration Assistance feature, will al my apps, bookmarks, contacts and files be tranferred?

    See Pondini's Setup New Mac guide

  • How to find particular date lies in between two given dates

    hi,
    i have a problem. i have to find if particular day lies in between two given dates.
    example two dates are joindate and expirydate.
    1.joindate is 1/03/2007
    expdate is 1/03/2008
    now i have to find if 29 feb is in between this joindate and expirydate.
    if any1 has ny idea please reply asap.
    thanks.

    The Date class has a before() and after() method you can use to compare Date objects.

  • Difference  between null vector and empty Vector

    What is the diffrence between null vector and empty vector.

    null vector means the JVM doesn't allocate memory.It doesn't exist
    in memory. NO instance!
    empty vector means the JVM allocated memory.It exists in memory.
    it's a instance than is accessabel.But only have on elements.
    GL&HF.

  • Change or delete the docflow link between two existing documents

    Hi All,
    Is there any FM or soulution to change the doc flow link between two documents .
    For ex .. i have document A and document B , and created a doc flow link from A to B , Now i have to change the succeeding document  to C
    I have tried to modify the doc link ,but its not working using crm_order_maintain.I thought of deleting the link between A and B and then create a new link Between A and C , but deletion of link bewteen A and B is also not working.
    I have checked with FMs CRM_DOC_FLOW_DELETE_CHECK_EC and CRM_DOC_FLOW_DELETE_EC, followed by CRM_ORDER_SAVE AND COMMIT . i could not find any exception from this FMs , but still the doc link is not deleted.
    Pls share if you have any suggestions.
    Regards,
    Nithish

    Hello
    I wrote a report to delink items from document flow. I uploaded it [here|http://wiki.sdn.sap.com/wiki/display/CRM/Removelinksfromdocumentflow].
    Please, use with caution and always perform careful tests before you run it in a production envinronment.
    Hope it helps
    Joaquin
    Edited by: Joaquin Fornas on Nov 15, 2011 11:49 AM

Maybe you are looking for

  • EAL extract fails with ORA-03113 end-of-file on communication channel error

    Hi, We are trying to run an EAL (v11.1.1.4) extract from an HFM (v9.3.1.4) environment onto Oracle database. We are able to run the extract successfully for few hundred records, but when the records exceeds 10 million we get the error below [03 Dec 2

  • Open popup from fragment through template

    All, I have some links in my page template and i want to open popups based on the click which are defined in separate page fragments. How do i achieve that ? Any sample example available for that ? thnks Jdev 11.1.1.5

  • Import of Private View cannot be resolved

    I have a web dynpro component I wrote a while ago.  I just pulled it down from NWDI.  Created the project.  Build works great.  Even made changes and checked in and activiated.  All things work. Here's the trouble.  When I look at the Implementation

  • Scrolling in lion?

          In Lion, scroll bars (vertical mostly) seem to appear and disappear at their own volition - how do you make them always available?

  • Can I get Microsoft Word on the Mac App Store?

    I am most likely going to buy a new MacBook Pro with Retina Display 13 inch model and I keep wondering if I can get Microsoft Word on the Mac App Store or if I have to buy it in a separate package. If anyone could answer this that would he great. :)