-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e769c7c
commit 387da41
Showing
5 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import * as THREE from 'three' | ||
import { gsap } from 'gsap' | ||
|
||
import Experience from './Experience.js' | ||
|
||
export default class TopChair | ||
{ | ||
constructor() | ||
{ | ||
this.experience = new Experience() | ||
this.resources = this.experience.resources | ||
this.debug = this.experience.debug | ||
this.scene = this.experience.scene | ||
this.world = this.experience.world | ||
this.time = this.experience.time | ||
|
||
// Debug | ||
if(this.debug) | ||
{ | ||
this.debugFolder = this.debug.addFolder({ | ||
title: 'topChair', | ||
expanded: true | ||
}) | ||
} | ||
|
||
this.setModel() | ||
this.setAnimation() | ||
} | ||
|
||
setModel() | ||
{ | ||
this.model = {} | ||
|
||
this.model.group = this.resources.items.topChairModel.scene.children[0] | ||
this.scene.add(this.model.group) | ||
|
||
this.model.group.traverse((_child) => | ||
{ | ||
if(_child instanceof THREE.Mesh) | ||
{ | ||
_child.material = this.world.room.material | ||
} | ||
}) | ||
} | ||
|
||
setAnimation() | ||
{ | ||
this.animation = {} | ||
} | ||
|
||
update() | ||
{ | ||
this.model.group.rotation.y = Math.sin(this.time.elapsed * 0.0005) * 0.5 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
387da41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: