max-mapper / max-mapper/voxel-engine
Allow camera overide in opts
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.3k
- Forks
- 217
- PR merge metrics
- No merged PRs in 30d
Description
I've been trying to get the voxel-engine to accept a custom camera (ie: OrthographicCamera )
and it would seem that the Game prototype needs something like this:
this.camera = this.createCamera( opts.camera || false )
and createCamera needs changing like so:
Game.prototype.createCamera = function( customCamera ) {
camera = customCamera || new THREE.PerspectiveCamera(60, this.width / this.height, 1, 10000)
camera.lookAt(new THREE.Vector3(0, 0, 0))
this.scene.add(camera)
return camera
}
Does this seem like a good idea, or am I being stupid? If not then pull request to follow.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Game.prototype.createCamera and the Game initialization that creates the camera; inspect how opts is passed and how THREE cameras are added to the scene. Confirm that a supplied OrthographicCamera is used while the default PerspectiveCamera behavior remains unchanged, then verify the resulting camera is added to the scene and positioned as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, three.js
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100