3.0.1 • Published 2 years ago

@michaelldev/ngx-profile-avatar v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Demo

  • You can see a live demo here

Cursor Tracker

The rotation of the model, head, eyes and neck will react to the movement of the cursor.

Cursor Tracker Demo

Face Tracker

Model rotation, head, neck and facial animations will react to your expressions and movements detected by the camera.

Face Tracker Demo

Generate your 3D Avatar

  1. Navigate to the following url: vr.readyplayer.me/avatar.
  2. Customize the look of your 3D avatar.
  3. When finished, copy the generated link to the file with extension .glb or download the file and add it to the assets folder of your project in Angular.

Avatar 3D Generator

Install NgxProfileAvatar

  1. Install the library in your project with the command: npm install @michaelldev/ngx-profile-avatar.
  2. Import NgxProfileAvatarModule in your app.module.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

import { NgxProfileAvatarModule } from '@michaelldev/ngx-profile-avatar';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    AppRoutingModule,
    //...
    NgxProfileAvatarModule,
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
  1. Use the ngx-profile-avatar component as the example below:
<ngx-profile-avatar 
    [url]="url" 
    [tracker]="tracker" 
    [enableRotate]="true" 
    [enableZoom]="true" 
    (loading)="onLoadingAvatar($event)" 
    style="position: fixed;inset: 0;width: 50%;height: 100%;">
</ngx-profile-avatar>
import { Tracker } from '@michaelldev/ngx-profile-avatar/lib';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
})
export class AppComponent {

  url: string = 'assets/avatar.glb';
  tracker: Tracker = 'cursor';

}
  1. Component documentation
InputDescriptionTypeDefault
[url]Public or local location of the .glb file containing the 3d model of your avatar.stringnull
[tracker]Reaction method of your model.'cursor' 'face''cursor'
[enableRotate]Enable mouse interaction to rotate the model.booleantrue'
[enableZoom]Enables mouse interaction to zoom in and out of the model.booleantrue
(loading)Emitter of .glb file loading progress event or of the Facial Tracker initialization progress event.EventEmitter<ProgressEvent>-

Important

Preferably, define tracker as cursor . The face option is still experimental.

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago