Skip to content
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

Feature: give the option to customize OEF. #328

Open
kalwalt opened this issue Nov 1, 2024 Discussed in #327 · 0 comments
Open

Feature: give the option to customize OEF. #328

kalwalt opened this issue Nov 1, 2024 Discussed in #327 · 0 comments
Assignees
Labels

Comments

@kalwalt
Copy link
Member

kalwalt commented Nov 1, 2024

Discussed in #327

Originally posted by v-litvintsev October 31, 2024
Hi! I cannot edit interpolationFactor, while in the react-three-arnft library interpolationFactor can be changed for ARCanvas, is it possible to change interpolationFactor without using react-three-arnft?

Or I can edit it only without ARnft class as in the example: https://kalwalt.github.io/jsartoolkit5/examples/nft_improved_worker/main_threejs_wasm_worker.html

import * as THREE from "three";
import { ARnft } from "@webarkit/ar-nft";
import ARnftThreejs from "@webarkit/arnft-threejs";

let width = window.innerWidth;
let height = window.innerHeight;
ARnft.init(
  width,
  height,
  [["/DataNFT/pinball"]],
  [["pinball"]],
  "/configs/config.json",
  0
)
  .then((nft) => {
    document.addEventListener("containerEvent", function (ev) {
      let canvas = document.getElementById("canvas");
      let fov = (0.8 * 180) / Math.PI;
      let ratio = width / height;
      let config = {
        renderer: {
          alpha: true,
          antialias: true,
          context: null,
          precision: "mediump",
          premultipliedAlpha: true,
          stencil: true,
          depth: true,
          logarithmicDepthBuffer: true,
        },
        camera: {
          fov: fov,
          ratio: ratio,
          near: 0.01,
          far: 1000,
        },
      };

      let sceneThreejs = new ARnftThreejs.SceneRendererTJS(
        config,
        canvas,
        nft.uuid,
        true
      );

      sceneThreejs.initRenderer();

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

      let imgConfig = { w: 1, h: 1, ws: 1, hs: 1 };
      nftAddTJS.addImage(
        "https://cdn.culture.ru/c/641257.jpg",
        "pinball",
        0xbbbbff,
        180,
        imgConfig,
        false
      );

      const tick = () => {
        sceneThreejs.draw();
        window.requestAnimationFrame(tick);
      };
      tick();
    });
  })
  .catch((error) => {
    console.log(error);
  });
```</div>
@kalwalt kalwalt added 🚀 enhancement New feature or request Feature request labels Nov 1, 2024
@kalwalt kalwalt self-assigned this Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant