augmentmy-world / arStudio

A innovative Web editor for Augmented Reality
https://webarstudio.tripod-digital.co.nz
MIT License
53 stars 34 forks source link

Testing arStudio with a pattern Hiro #23

Closed kalwalt closed 4 years ago

kalwalt commented 4 years ago

Testing arStudio

Basic Setup

I'm testing the basic functionality of arStudio, i started with the simplest scene:

The scene file in .json format is here:

simple_cube.zip

Testing instructions

Load the file locally, go to Project > Load > From File then select your file and upload the file in the scene clicking the Load File button. At this point select the player tab on the left of the editor and run the play button on the fight top of the editor. My result with a Hiro pattern is this:

Schermata da 2020-02-21 18-05-18

The cube should be perfectly sovraimposed on the Hiro marker but it doesn't. It is shifted in the wrong axis, and when the Pattern is rotated the cube rotate in the wrong manner.

Maybe we use the wrong matrix or what? My setup is wrong?

ThorstenBux commented 4 years ago

Position z=0.5 not y

Get Outlook for iOShttps://aka.ms/o0ukef


From: Walter Perdan notifications@github.com Sent: Saturday, February 22, 2020 6:31:14 AM To: augmentmy-world/arStudio arStudio@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [augmentmy-world/arStudio] Testing arStudio with a pattern Hiro (#23)

Testing arStudio Basic Setup

I'm testing the basic functionality of arStudio, i started with the simplest scene:

The scene file in .json format is here:

simple_cube.ziphttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Faugmentmy-world%2FarStudio%2Ffiles%2F4237228%2Fsimple_cube.zip&data=02%7C01%7C%7C6174bfc12b65401d3fc808d7b6f3db1b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637179030773008268&sdata=%2FsOHQKAGdAy5OYlgby00ilH%2Fn1%2BeHJqd33gCSLpxRBA%3D&reserved=0

Testing instructions

Load the file locally, go to Project > Load > From File then select your file and upload the file in the scene clicking the Load File button. At this point select the player tab on the left of the editor and run the play button on the fight top of the editor. My result with a Hiro pattern is this:

[Schermata da 2020-02-21 18-05-18]https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F1275858%2F75056586-a0298980-54d7-11ea-9039-95e43fffb905.png&data=02%7C01%7C%7C6174bfc12b65401d3fc808d7b6f3db1b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637179030773018248&sdata=OmepWa68lANASix1%2BKlazDMQhhw15PXfYMP%2FrsYwQis%3D&reserved=0

The cube should be perfectly sovraimposed on the Hiro marker but it doesn't. It is shifted in the wrong axis, and when the Pattern is rotated the cube rotate in the wrong manner.

Maybe we use the wrong matrix or what? My setup is wrong?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Faugmentmy-world%2FarStudio%2Fissues%2F23%3Femail_source%3Dnotifications%26email_token%3DAD765PCKESXSBPAKBZWXTP3REAFWFA5CNFSM4KZHIDUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IPLTAUA&data=02%7C01%7C%7C6174bfc12b65401d3fc808d7b6f3db1b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637179030773028226&sdata=NK2uC35xCwuOQ7%2BxLz%2BfBbIXEn9G1Qd0JrnIeAipAzo%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD765PHJOMDYBZYBD3HOCATREAFWFANCNFSM4KZHIDUA&data=02%7C01%7C%7C6174bfc12b65401d3fc808d7b6f3db1b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637179030773038217&sdata=XTeqpJy0TZxpBuDRr145OZrsk%2F3hJah7iuSOEHOq1HM%3D&reserved=0.

kalwalt commented 4 years ago

I tried also to change the other axis, the result was worst, but maybe the editor wasn't refreshing properly needs to try again. I would create some basic example so everybody can test.

itamayo commented 4 years ago

You're doing a great job. I have tested it but seems is not display the cube, https://drive.google.com/file/d/1jisOl36N5faSiYIEOwA4QCgw6ERw2WiI/view,

From logs, the application detects the marker but nothing is displaying:

warning: viewprojection matrix contains NaN when enableCamera is used
saw a trackable with id 0

EDIT: If I change to scene view I can see how is affecting camera changes to cube position ...

kalwalt commented 4 years ago

@itamayo we noted that it should be an issue with resizing (or related to) if you open the devTool what happens? or if you resize the window?

itamayo commented 4 years ago

The console, not showing any error, only warnings about viewprojection matrix. resize is not making any change, I saw that this.originalProjectionMatrix has NaN values, does can be the problem ? EDIT: this.arCamera.getProjectionMatrix is return first value as NaN

itamayo commented 4 years ago

Matrix get NaN after this line: https://github.com/augmentmy-world/arStudio/blob/f456ea749f2ab5ba4bf420816f89b65e427ac884/editor/js/components/arcontroller.component.js#L289

kalwalt commented 4 years ago

The console, not showing any error, only warnings about viewprojection matrix. resize is not making any change, I saw that this.originalProjectionMatrix has NaN values, does can be the problem ? EDIT: this.arCamera.getProjectionMatrix is return first value as NaN

i had sometimes that error but the model showed. I says about the devConsol, try this now: with the editor open, open the devConsole, then load the example file and start the simulation.

itamayo commented 4 years ago

Sorry but it isn't working, here a video. Seems that all process works (tracking) but not displaying I have test with different resolution, with differente browser (firefox,chrome v80) https://drive.google.com/file/d/1rRMPlIAPDjBOFW6VZb-hQspXY6ry9kqr/view?usp=sharing EDIT : I'll tested on another user computer.

kalwalt commented 4 years ago

@itamayo could be also that recent changes broke that example, as i'm bit busy (also for the upcoming v3.0.0 release of AR.js ) it's diffcult to say what's the problem now. If ihave a bit of time i will go back on this this late evening.

itamayo commented 4 years ago

thanks, I tried different commits but I didn't get working, I am little bit loss, thanks anyway and good luck with the AR.js 3v release ;)

itamayo commented 4 years ago

The problem is in this commit (commit before works!): https://github.com/augmentmy-world/arStudio/commit/f456ea749f2ab5ba4bf420816f89b65e427ac884

There are some bugs using jquery ... Perhaps the best approach to rendering 3D content and video is to render video through 3D rendering, rather than rendering in html layers. To avoid resizing problems and so on...

kalwalt commented 4 years ago

The problem is in this commit (commit before works!): f456ea7

There are some bugs using jquery ...

it could be, i will test again. Probably solved that issue but is sort out another, though looks strange to me.

Perhaps the best approach to rendering 3D content and video is to render video through 3D rendering, rather than rendering in html layers. To avoid resizing problems and so on...

Do you mean rendering in a separate window?

itamayo commented 4 years ago

Do you mean rendering in a separate window?

No, I mean render the video frame in the same canvas application is rendering the 3D content. rather than using video tag and canvas tag one over the other. I have done in another project, render video frame to virtual canvas, send this image to process to artoolkit, when tracking is hit, render video texutre plane + 3d objects. This way there is no need to adjust canvas tag and video tag since everything is the same 3d world.

kalwalt commented 4 years ago

No, I mean render the video frame in the same canvas application is rendering the 3D content. rather than using video tag and canvas tag one over the other. I have done in another project, render video frame to virtual canvas, send this image to process to artoolkit, when tracking is hit, render video texutre plane + 3d objects. This way there is no need to adjust canvas tag and video tag since everything is the same 3d world.

@itamayo we can discuss on it together with @ThorstenBux on a separate issue, I am open to any enhancement to the plugin.

itamayo commented 4 years ago

ok ! thanks for your help ;)

ThorstenBux commented 4 years ago

fixed with https://github.com/augmentmy-world/arStudio/pull/28 I think. Feel free to reopen