I am looking to create a unique model that combines the functionality of Backbone.Model with another prototype from THREE.Object3D in three.js version r69. Currently, my approach involves creating an object and setting its prototype to be that of THREE.Object3D like this:
var MyObj = new function(){...}
MyObj.prototype = Object.create(THREE.Object3D.prototype);
MyObj.prototype.constructor = THREE.Object3D;
However, I am facing challenges in making MyObj an instance of Backbone.Model while still retaining the THREE.Object3d prototype so that I can seamlessly add it to a scene and use it as a regular THREE.Object3d without compromising the Backbone.Model interface.
When I attempt to extend Backbone.Model with THREE.Object3D's prototype using the following code:
var MyObj = Backbone.Model.extend(THREE.Object3D.prototype);
I encounter errors related to attributes being undefined, particularly rotation. I am unsure why this is happening. Why is rotation showing up as undefined?
EDIT: Check out my fiddle here. Don't forget to open the console to view the errors!