https://github.com/ar-js-org/ar.js-threejs
An experimental Typescript module for AR.js
https://github.com/ar-js-org/ar.js-threejs
arjs es6 threejs typescript
Last synced: about 1 year ago
JSON representation
An experimental Typescript module for AR.js
- Host: GitHub
- URL: https://github.com/ar-js-org/ar.js-threejs
- Owner: AR-js-org
- License: mit
- Created: 2023-01-18T23:11:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-29T17:26:06.000Z (about 2 years ago)
- Last Synced: 2024-04-23T22:55:21.182Z (about 2 years ago)
- Topics: arjs, es6, threejs, typescript
- Language: TypeScript
- Homepage:
- Size: 11.1 MB
- Stars: 27
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AR.js-threejs ๐
Testing repository for the AR.js core module. I'm converting AR.js code to the Typescript language but providing the same classes and structures as much as possible.
The module export two namespaces as in the old implementation: **THREEx** and **ARjs**.
The project is under development, so things could not works as expected. If you find a bug file an issue at our [issues](https://github.com/AR-js-org/AR.js-threejs/issues)
## List of classes in the namespaces ๐
### THREEx:
- [x] ArBaseControls
- [x] ArClickability
- [x] ArMarkerCloak
- [x] ArMarkerControls
- [x] ArMarkerHelper
- [x] ArSmoothedControls
- [x] ArToolkitContext
- [x] ArToolkitSource
- [x] ArToolkitProfile
- [x] ArVideoinWebgl
- [x] HitTestingPlane
### ARjs:
- [x] Anchor
- [x] AnchorDebugUI
- [x] Context
- [x] HitTesting
- [x] Session
- [x] SessionDebugUI
- [x] Source
- [x] Profile
- [x] Utils
## Examples ๐ก
For now, you can find some vanilla JS examples in the **examples** folder and anothers in Typescript in the **example-ts** folder. More examples will be added in a near future.
Update 20/10/2024: Now also NFT examples.
Update 13/01/2025: Vite example, see example-vite folder.
## Three.js version ๐ ๏ธ
### Three.js version
This project uses Three.js version 0.164.0. The examples and code are updated to use the new syntax with `importmap` for module imports. Previous versions of Three.js are not supported, but the old AR.js is still available.
## Test it with Typescript ๐งช
First, you need to add the `ar.js-threejs` package to your project:
`npm install @ar-js-org/ar.js-threejs`
then in your typescript code you can import the `THREEx` and `ARjs` namespaces:
```typescript
import { THREEx, ARjs } from "@ar-js-org/ar.js-threejs"
var arToolkitSource = new THREEx.ArToolkitSource({
// to read from the webcam
sourceType: 'webcam',
sourceWidth: window.innerWidth > window.innerHeight ? 640 : 480,
sourceHeight: window.innerWidth > window.innerHeight ? 480 : 640,
})
// other Ar.js code...
```
After, you need a bundler (webpack, rollup..) to build the final app. look at _example-ts_ for this purpose.
## Feature to add ๐
- [ ] markers-area with multimarker support?