-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix positioning of content #41
Comments
@kalwalt you said on Slack, it's possible to understand width/height of given image. Where can we do that? So knowing that, where we recognize the marker, we can try to change it position to: position.x = position.x + width/2 |
When the NFT marker is loaded inside the loadNFTMarker: the surfaceSet pointer ( alias for a AR2SurfaceSetT struct) is filled with all the data from the NFT marker (width, height, dpi, image data, feature points...) so we can obtain all the data we needs from here. AR2SurfaceSetT is a struct defined in https://github.com/artoolkitx/artoolkit5/blob/6742d9f5c4a06673a3805e097d924f8e0c55f8ca/include/AR2/tracking.h basically contain a chained series of structs inside of them there is an AR2ImageSetT struct where are stored the width, height dpi and image data: |
Great! Are you able to set two variables (width and height) that can then be available in the |
Yes, that should be doable ( in theory ): i will start to work to it. |
Actually i solved in this way, given the width, height and dpi from the .fset file we can calculate the position of the model in the center of the marker with: model.position.y = (msg.height / msg.dpi * 2.54 * 10)/2.0;
model.position.x = (msg.width / msg.dpi * 2.54 * 10)/2.0; see this commit 86a1980 |
Hi, @kalwalt and @nicolocarpignoli, I hope to help the procedure with some comments. I have been commenting the approach in the PR of this issue. #42 (comment) |
Content is now shown at the left-bottom corner of the recognised image.
I think that we should try to make it appear at the center of the image, with the user able to move it, if wanted to - widespread use will be with the content at center of the image/covering the whole image.
The text was updated successfully, but these errors were encountered: