Code Monkey home page Code Monkey logo

arnft-threejs's Introduction

arnft-threejs's People

Contributors

kalwalt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

arnft-threejs's Issues

Video is black on Android Chrome, iOS Chrome and iOS Safari

Hi,

I tried this arNFT_video_example on multiple devices and the video seems to be black (or just stuck on 1st frame?). Here's a screenshot of what the video looks like:

black video

The video work only on android chrome. On android firefox, iOS chrome, iOS safari - the video is black. I also tried using the library with other videos but same happens with other videos.

Expose planeGeometry for addVideo to support different video ratios

At present the plane geometry for a video has a fixed planeGeometry of [1,1,1,1] which just creates a very basic square or a 1:1 ratio video , this really isn't helpful as the vast majority of videos are 16:9. This makes any video of a video other than 16:9 display incorrectly.

I would propose that you expose these at as a argument when adding a video to a scene using ARnft, I would also expose the height and width segmentation too.

Can I get marker's 3d position data?

I want to display a 3d model after scanned an image marker. I tried the example one but I want to try update the model with my own code.

May I know if it is possible for me to build my own three js 3d world and hide the models. Then I use the callback from ARnft to display the object and update its position to the marker?

Video/Image always square. Any settings that could support width/height ratio tuning?

This toolkit is so awesome that I almost had no trouble to set things up :)

During my test, ideally we would love to cover the whole marker with media content. While under default setting, the height and width are almost identical even it is a 1024x480 or 360x720 media file.

@kalwalt Any input or code modification guidance would be appreciated. Thanks in advance!!

Also some heads up: the video is blacked out in iOS 14.6 (which never happened in previous iOS releases). I guess it is relevant with new privacy rules introduced.

No remove function for added models.

Hi Guys,
is there any way to remove added model? I can only find these functions:

  • add
  • addmodel
  • addImage
  • addVideo

can someone help me please figure it out, any help will be appreciable.
Thank you

Is there a non-minified copy of ARnftThree.js?

I'm certain I'm just missing it, but for some reason I can't seem to find (or generate) a non-minified version of the ARnftThree.js?

Does anyone know what the correct npm or yarn command would be to generate one?

ARnftThreejs sometimes not start

webarkit/ARnft#204

I came from the above thread. I was trying to use my own camera source. So I have the following script

navigator.mediaDevices.enumerateDevices()
.then(gotDevices)
.then(function(){
    navigator.mediaDevices.getUserMedia({
          video: constraints
    })
 .then(function(stream){
      window.stream = stream;
      video.srcObject = stream;

       const entities = [
                  { name: 'game1', markerUrl: "/markers/game1" },
                  { name: 'game2', markerUrl: "/markers/game2" },
                  { name: 'game3', markerUrl: "/markers/game3" },
          ];
                   
      ARnft.ARnft.initWithEntities(640, 480, entities,  '/config.json', true)
      .then((nft) => {
      });

And I commented out navigator.mediaDevices code in ARnft.js. Then, the last console log is ARnftThreejs version: 0.2.0. It seems cannot keep loading the remaining library. Without anymore console log and error log.

    <script src="/js/three.min.js"></script>
    <script src="/js/ARnftThreejs.js"></script>
    <script src="/js/ARnft.js"></script>
    <script src="/js/main.js"></script>

I was using the above structure. ARnft ini function was wrapped inside my custom getUserMedia function in main.js. It causes the ARnftThreejs not keep load. However, there is no problem when I test in desktop and the latest Samsung phone. It has problem only in my old Android phone.

    <script src="/js/three.min.js"></script>
    <script src="/js/ARnftThreejs.js"></script>
    <script src="/js/ARnft.js"></script>
    <script src="/js/main.js"></script>
    <script>
        const entities = [
            { name: 'game1', markerUrl: "/markers/game1" },
            { name: 'game2', markerUrl: "/markers/game2" },
            { name: 'game3', markerUrl: "/markers/game3" },
        ];
  
        ARnft.ARnft.initWithEntities(640, 480, entities,  '/config.json', true)
        .then((nft) => {})

lastly, when i move the function out. it works again. i am not sure the reason

OBJ + MTL file

Hi, I am facing problem in loading OBJ & MTL 3D model using ARnft. Is there any example for this case?
As i know using addModel function can only apply to glTF model or glb model.
image

Toggling multiple gltf models

Hi guys,
I am trying to achieve an AR experience for the Restaurant menu, so multiple models involved in this project. How can I achieve toggling multiple models on a single NFT marker? Please guide me to achieve this.

My Suggestion:
ARnft is an awesome framework for image tracking compared to other frameworks like AR.js etc. The only thing lack in this project is documentation, if there is proper documentation then I think more people will choose this framework for WebAR. Kudos to the developer @kalwalt . ๐Ÿ‘

GLTF Animation not working

Hello I'm add gltf model and play animation mixer, But ot not working.
I'm using GLTFLoader and Animation Mixer. then I add model by NFTaddTJS. After my tracking my models show but not play animation. Thank you

video position and size

Hi , can you explain how to change video size (height and weight) and it's position related to tracked image ? I want my video cover all image.

GLTF Animation not working

Hello I'm add gltf model and play animation mixer, But ot not working.
I'm using GLTFLoader and Animation Mixer. then I add model by NFTaddTJS. After my tracking my models show but not play animation. Thank you

addImage - multiple images and different configs doesn't appear to work

I have two markers, each with their own image, with different configuration ...

It doesn't appear that the config/scale/etc is respected for each addImage -am I doing something wrong?

		               let nftAddTJS = new ARnftThreejs.NFTaddTJS(nft.uuid);
		               nftAddTJS.oef = true;

                                // Set width, height and width and height number of segments of the PlaneGeometry.
				let imgConfig = {
		                  w: 1,
		                  h: 0.3,
		                  ws: 1,
		                  hs: 1
		               };
			       nftAddTJS.addImage('Data/newspaper2_clean_hidden_small.png', 'newspaper2_clean', 0xdddddd, 660, imgConfig, false);



		               // Set width, height and width and height number of segments of the PlaneGeometry.
		               let imgConfig2 = {
		                  w: 1,
		                  h: 1,
		                  ws: 1,
		                  hs: 1
		               };
		               nftAddTJS.addImage('Data/puzzle.png', 'puzzle_bkgrnd', 0xbbbbff, 500, imgConfig2, false);

Turn off visibility of added 3D model

How do turn off the visibility of an added 3d model?
I tried this code for toggling visibility, but its not doing anything.

code:
nftAddTJS.objVisibility=false;

Any help is appreciated. Thank you.

Object is not hide by default and not visible on marker scan

Hello I'm trying to create a 3D TEXT object which will replace the red cube.

I loaded a font and create a 3D Text and add into the scene but I got 2 issues.

  • Text Size is too big and only visible if I do geometry.center()
  • Text is visible by default and not didn't hide or unhide.

Sample code

const fontLoader = nftAddTJS.getFontLoader();
 fontLoader.load(`./fonts/${fontName}`, (font) => {

 var material = new THREE.MeshStandardMaterial({ color: new THREE.Color(obj.color).convertSRGBToLinear(),  side: THREE.DoubleSide })
 material.transparent = true;

    **// TextGeometry exported from nftAddTJS**
    const geometry = nftAddTJS.createTextGeometry(obj.resource.title, {
                font: font, 
               size: parseInt(obj.resource.size) * 0.000001,  **//ISSUE: Size need to provide in decimal or else it create a large text**
               height: 1,
              curveSegments: 12     
          })
         
         geometry.center() 
                                    
         var mesh = new THREE.Mesh(geometry, material);
         
          mesh.scale.set(obj.scale.x, obj.scale.y, obj.scale.z)
          mesh.rotation.set(obj.rotation.x, obj.rotation.y, obj.rotation.z)

           mesh.position.set(1000, 200, 90)  **// If I change the position from (x:0, y:0, z:0) text is not visible on the canvas** 
           nftAddTJS.add(mesh, '3dText', false)
      })

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.