A Simple 3D Engine
Who am I?
Who am I?
• My name is Paul
Who am I?
• My name is Paul

• I’m a developer with about 10 years of experience
Who am I?
• My name is Paul

• I’m a developer with about 10 years of experience

• I work for HUGE in London
Who am I?
• My name is Paul

• I’m a developer with about 10 years of experience

• I work for HUGE in London

• Findable on Twitter as @aerotwist
Who am I?
• My name is Paul

• I’m a developer with about 10 years of experience

• I work for HUGE in London

• Findable on Twitter as @aerotwist

• Findable on the interwibble at http://aerotwist.com
“I know, I’ll make a
    3D engine!”
Why bother?
Why bother?
• There are already loads: Three.js, J3D, PhiloGL, etc
Why bother?
• There are already loads: Three.js, J3D, PhiloGL, etc

• A great opportunity to learn
Why bother?
• There are already loads: Three.js, J3D, PhiloGL, etc

• A great opportunity to learn

• An even better opportunity to share
Why bother?
• There are already loads: Three.js, J3D, PhiloGL, etc

• A great opportunity to learn

• An even better opportunity to share

• ... and Bartek Drozdz suggested it
“I have no idea how
to make a 3D engine.”
         :(
“I’ll try anyway!”
Elevator Pitch
Elevator Pitch
• Make a simple 3D engine
Elevator Pitch
• Make a simple 3D engine

• Make it feature-limited... feature-selective ;)
Elevator Pitch
• Make a simple 3D engine

• Make it feature-limited... feature-selective ;)

• Make it Open Source and available on GitHub
Elevator Pitch
• Make a simple 3D engine

• Make it feature-limited... feature-selective ;)

• Make it Open Source and available on GitHub




http://github.com/paullewis/a3
Goalz
Goalz
• Try and write a 3D engine a developer can use
Goalz
• Try and write a 3D engine a developer can use

• Get API documentation “for free”
Goalz
• Try and write a 3D engine a developer can use

• Get API documentation “for free”

• Keep it lean and mean
Goalz
• Try and write a 3D engine a developer can use

• Get API documentation “for free”

• Keep it lean and mean

• Record videos explaining the process
Developer APIs
Developer APIs
• Really difficult
Developer APIs
• Really difficult

• You know your own code
Developer APIs
• Really difficult

• You know your own code

• You don’t know what a developer wants to do
Developer APIs
• Really difficult

• You know your own code

• You don’t know what a developer wants to do

• You may screw it up a bit :)
Developer APIs
• Really difficult

• You know your own code

• You don’t know what a developer wants to do

• You may screw it up a bit :)

• Advice: get help
For your Renderer class why did you go
   with a shortcut namespace of A3.R
         instead of A3.Renderer?

That tripped me up initially because it was
   inconsistent with how you shortcut
   namespaced your other class files.
                          - Joshua Perez, via email
Free Documentation
Free Documentation
• Really easy
Free Documentation
• Really easy

• With JavaScript just use JavaDoc comments
Free Documentation
• Really easy

• With JavaScript just use JavaDoc comments

• Run jsdoc-toolkit against it as part of the build
Free Documentation
• Really easy

• With JavaScript just use JavaDoc comments

• Run jsdoc-toolkit against it as part of the build

• Automagic wonders will follow
Keeping It Small
Keeping It Small
• Really hard
Keeping It Small
• Really hard

• Functionality is either core or addon
Keeping It Small
• Really hard

• Functionality is either core or addon

• Core is always included, addon toggled in the build
Keeping It Small
• Really hard

• Functionality is either core or addon

• Core is always included, addon toggled in the build

• 99% right now is core
Keeping It Small
• Really hard

• Functionality is either core or addon

• Core is always included, addon toggled in the build

• 99% right now is core

• The engine is about 13KB gzipped (53KB normal)
Videos
Videos
• Really time consuming
Videos
• Really time consuming

• Hard to distil knowledge in a meaningful way
Videos
• Really time consuming

• Hard to distil knowledge in a meaningful way

• Hard to work out how useful they are
Videos
• Really time consuming

• Hard to distil knowledge in a meaningful way

• Hard to work out how useful they are

• I’m running behind
Features
Features
• Geometry abstraction
Features
• Geometry abstraction

• Phong and Lambert shading
Features
• Geometry abstraction

• Phong and Lambert shading

• Lighting
Features
• Geometry abstraction

• Phong and Lambert shading

• Lighting

• Cameras
Features
• Geometry abstraction

• Phong and Lambert shading

• Lighting

• Cameras

• Scene graph
Features
• Geometry abstraction

• Phong and Lambert shading

• Lighting

• Cameras

• Scene graph

• Cube mapping
Features
• Geometry abstraction

• Phong and Lambert shading

• Lighting

• Cameras

• Scene graph

• Cube mapping

• Texturing
http://lab.aerotwist.com/webgl/a3/samples/07
http://lab.aerotwist.com/webgl/strange-attractor
http://lab.aerotwist.com/webgl/undulating-monkey
Conclusion
Conclusion
• Have goals
Conclusion
• Have goals

• Be willing to refactor and change things
Conclusion
• Have goals

• Be willing to refactor and change things

• Ask a few people to help you
Conclusion
• Have goals

• Be willing to refactor and change things

• Ask a few people to help you

• Write plenty of samples
Conclusion
• Have goals

• Be willing to refactor and change things

• Ask a few people to help you

• Write plenty of samples

• Share and be open
but mainly...
if you have a
 crazy idea...
DO IT!
  :)
Cheers
http://aerotwist.com/a3

WebGL Camp 4 - A3 3D Engine