Trouble navigating NyARToolkit

Discussion in 'C#' started by Suit, Aug 31, 2010.

  1. Suit

    Suit New Member

    Aug 31, 2010
    Likes Received:
    Trophy Points:
    I'm having a little trouble figuring out a method for calculating the distance between the marker and the camera in NyARToolkit. Because the meshses are scaled according to the size of the marker (and the marker pattern is described as a specific scale), I figured that by knowing the size of the marker, you could calculate its distance in the frustum.

    I know they set a minimum and maximum length of the frustum(1cm - 10m).
    I know that an NyARSquare will give you the center of the square in 2D screen-coordinate space, as well as 4 points (1 for each corner).
    I know that you can calculate the transform from the points to make an actual 2D square.
    I know that you can calculate the transformed square's distance from the camera if you know the size.

    But I DON'T know how to put all of this together, because I don't know NyARToolkit well enough to pull the proper information (such as where to pull the information from the NyARSquare and where to access the frustum information.)

    So if anyone can answer where in the "SingleARMarkerDirect3D" sample project provided in the NyARToolkit, I may go to properly access all of the needed information and calculate the marker's distance, it would be greatly appreciated!

    Thank you,

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice