Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular Module #322

Open
2 of 19 tasks
looading opened this issue Sep 22, 2017 · 8 comments
Open
2 of 19 tasks

Angular Module #322

looading opened this issue Sep 22, 2017 · 8 comments

Comments

@looading
Copy link

looading commented Sep 22, 2017

Describe your issue here.

Do you have any plan to provide a Angular moudle?

Version:
  • v2.x.x
  • v1.x.x
Issue type:
  • Bug
  • Proposal/Enhancement
  • Question
  • Discussion

Tested on:
Desktop
  • Chrome
  • Chrome Canary
  • Chrome dev-channel
  • Firefox
  • Opera
  • Microsoft IE
  • Microsoft Edge
Android
  • Chrome
  • Firefox
  • Opera
IOS
  • Chrome
  • Firefox
  • Opera
@sasha240100
Copy link
Member

@looading what should it do?

@noahcoetsee
Copy link
Contributor

noahcoetsee commented Sep 22, 2017

An angular module? Angular is based on live HTML editing through the change of variables. That should be something done entirely on your side, it's pretty much unrelated to 3D WebGL. DatGUI Does the same thing with a little bit of a twist. I don't understand why you would want an Angular module, please clarify.

@looading
Copy link
Author

Inspired by the react-whs project, why don`t we integrate Angular and WHS?
Then I thought for a moment. whether we can simply package Core/Components/Modules of the WHS into Components/Directive/Service of the Angular. Pack those int to a Angular Modules, like ng-whs.

Then. for example, if we want to create an 3D sence in a Angular Component.

  1. import module
// app.moudls.ts
import { NgWhsModule } from 'ng-whs';

...

@NgModule({
    imports: [
        NgWhsModule,
        ...
    ],
    ...
})
export class AppModule {}
  1. use ng-whs
<!-- app.component.html -->
<whs-container
    [scene]='scene'
    [camera]='camera'
    >
    <Sphere
        [geometry]='geometry'
        ...
        ></Sphere>
    <BasicSphere
        [position]='position'
        ...
        ></BasicSphere>
    <Line
        [material]='material'
        ...
        ></Line>
</whs-container>
// app.component.ts
import { Component, OnInit } from '@angular/core';
import { WhsService, Sence } from 'ng-whs';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: './app.component.scss',
})
export class AppComponent implements OnInit {
    
    public scene: Sence;
    ...
    
    constructor(private whs: WhsService) {
    }
    
    ngOnInit() {
        this.sence = this.whs.createSence();
        ...
    }
}
  1. done

At last,ng developers may only need to spend very little time to create an 3D sence which they want.

write less, more simple and more intuitive. I think it`s cool.

@sasha240100
Copy link
Member

sasha240100 commented Sep 25, 2017

@looading I've got the idea now. Yes, that can be done as separate open source project on github. Would you like to start the development? We can guarantee you support during the development

@looading
Copy link
Author

@sasha240100 Ok, i will start the development a few days later.
Before that, i will do more research.

@meronbrouwer
Copy link

@looading From your issue, I get the impression that you already have whs working within ng. I'm trying to do the same, but am a bit puzzled on how to approach this. Do you have a working example ?

@looading
Copy link
Author

@meronbrouwer There are no examples available online at the moment.But, you can open a new issue to discuss your puzzles in detaild.

@meronbrouwer
Copy link

@looading thanks for the reply. I'll create a new issue if I bump into new problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants