JohnnyDevNull

Angular + BabylonJS and Angular + ThreeJS Template

Recommended Posts

Dear ladies and gentleman,

for playing around with some web gl rendering i started playing with threeJS a few years ago, but wanted also to get a look in babylonJS.

So here are two angular template projects which i want to share with all of you who also want to play something around with or maybe to built a real app from with it:

Angluar 6 + BabylonJS

https://github.com/JohnnyDevNull/ng-babylon-template

Angular 6 + ThreeJS

https://github.com/JohnnyDevNull/ng-three-template

Both have the example code running.

 

Have some fun!

Share this post


Link to post
Share on other sites

Hello, thank you for your job!

I have a little question. I want to add the OrbitControl:

import * as THREE from 'three';

export class EngineService
{
    // ...
    private controls: THREE.OrbitControls;
    // ...

    createScene(elementId: string): void
    {
        // ...
        this.controls = new THREE.OrbitControls(this.camera);
        // ...
    }

    render()
    {
        // ...
        this.controls.update();
        // ...
    }
}

I see the warning message in the VSCode console:

Quote

WARNING in ./src/app/engine/engine.service.ts
19:28-47 "export 'OrbitControls' (imported as 'THREE') was not found in 'three

And I see the error message in the browser console:

Quote

AppComponent.html:1 ERROR TypeError: three__WEBPACK_IMPORTED_MODULE_0__.OrbitControls is not a constructor
    at EngineService.push../src/app/engine/engine.service.ts.EngineService.createScene (engine.service.ts:35)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.