Interactive 3D Avatar Profile Viewer generated in Ready Player Me
The rotation of the model, head, eyes and neck will react to the movement of the cursor.
Model rotation, head, neck and facial animations will react to your expressions and movements detected by the camera.
.glb
or download the file and add it to the assets
folder of your project in Angular
.npm install @michaelldev/ngx-profile-avatar
.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 { }
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';
}
Input | Description | Type | Default |
---|---|---|---|
[url] |
Public or local location of the .glb file containing the 3d model of your avatar. |
string |
null |
[tracker] |
Reaction method of your model. | 'cursor' 'face' |
'cursor' |
[enableRotate] |
Enable mouse interaction to rotate the model. | boolean |
true' |
[enableZoom] |
Enables mouse interaction to zoom in and out of the model. | boolean |
true |
(loading) |
Emitter of .glb file loading progress event or of the Facial Tracker initialization progress event. |
EventEmitter<ProgressEvent> |
- |
Important
Preferably, define tracker as
cursor
. Theface
option is still experimental.