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

nObject class and functions for it. #22

Open
Smilebags opened this issue Feb 16, 2017 · 38 comments
Open

nObject class and functions for it. #22

Smilebags opened this issue Feb 16, 2017 · 38 comments
Assignees

Comments

@Smilebags
Copy link
Owner

This is a place to track proposals and progress on the nObject class and related functions. I'm working on an initial constructor function to lay out the basics of how it will all work.

I'm thinking of moving to typescript for this to allow for easier development.

@Smilebags Smilebags self-assigned this Feb 16, 2017
@Smilebags
Copy link
Owner Author

@max0410 are you familiar with TypeScript and able to work with it? If so I might work on re-organizing the code as TS files then bring them together compile-time.

@max0410
Copy link
Contributor

max0410 commented Feb 17, 2017

Yes, I am familiar with typescript. I might be a bit rusty though. But, isn't just javascript with classes and some other fancy functions? I wouldn't mind if you did it in typescript.

@max0410
Copy link
Contributor

max0410 commented Feb 17, 2017

I added nShift #23

@Smilebags
Copy link
Owner Author

Thanks for the PR.

Typescript (as you probably know) allows strong typing. It means we can define data structures for things like the nObject, which can then be error-checked and viewed anywhere in the code. It helps things to be more readable and scalable, and means we can easily split the library into more manageable chunks. If you have a suitable environment for working in TS, I'll convert the project.

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

Yes, i have an environment.

I recently got @shiffman 's attention on a live stream about p5js dimensions, and he said he would gladly do it if I either tweet or sent a github issue on his channel repo with more info. I know you'll probably say yes, but I just want to get your approval.

@Smilebags
Copy link
Owner Author

Great.

For him to convert it to TS? Or to publicise it? Thanks for asking but you don't need my permission to do stuff like that! Go ahead! This is our repo, you've done half the work, so feel free to do anything you like.

@Smilebags
Copy link
Owner Author

image
^^

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

No, no, no! He would just make a video about it! He wouldn't be making a cool project out of it, not contributing.

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

I guess I just though you'd like to know.

@Smilebags
Copy link
Owner Author

Yeah, that sounds good! Thanks for letting me know. Maybe I'll create a new branch for TS conversion (and we will work on the nObject in there?) so that the library isn't constantly changing, potentially with bugs to anyone trying to use it.

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

Ok!

@Smilebags
Copy link
Owner Author

I have had a look at converting to TS and it is more messy than I thought. I mean all you have to do is rename the file, but to get it to work nicely and not show lots of errors is a bit harder. Are you familiar with how to say that the project is dependent on p5 in TS?

@Smilebags
Copy link
Owner Author

I have a feeling some sort of import should work but I just don't know how to get it to work.

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

To tell the truth I don't know much about TS. I'll research it.

@Smilebags
Copy link
Owner Author

Smilebags commented Feb 18, 2017

Me too! high-5 I know it is worth using for larger projects but I've only really dabbled in the basics of it.

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

Do you really get any errors just by renaming the file? Probably some warnings, but I don''t see why there would be errors.

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

Also I sent him a tweet:
@shiffman Here is something for a coding train video! Try out p5 dimensions! http://github.com/Smilebags/p5.dimensions.js

Hopefully he responds soon!

@Smilebags
Copy link
Owner Author

TypeScript Errors are more picky than JavaScript ones. For example every p5.prototype.something line gives an error saying "Cannot find name 'p5'."

@Smilebags
Copy link
Owner Author

It still compiles, if you allow it to, but it isn't clean TypeScript.

@Smilebags
Copy link
Owner Author

Thanks! I look forward to his reply.

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

Ah

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

About, the nD viewer idea. Here is a site about 4d visualizations: http://www.math.union.edu/~dpvc/math/4d/models/welcome.html

@Smilebags
Copy link
Owner Author

This is the same idea I had, pretty much. But I want to make it easy to interact with. It would be perfect if rotating the object in nD and moving/controlling the camera in nD was simple. Also the 'slice' view they show, I've been trying to work out how to do it. Doesn't seem easy. Cool link, thanks!

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

I'll look in to their code.

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

I got a response from @shiffman! He told me to make an issue in his channel repo.

@max0410
Copy link
Contributor

max0410 commented Feb 18, 2017

Though I need to give him some topic or challenge around our library, any suggestions?

@Smilebags
Copy link
Owner Author

Great! Hmm it is hard... Once the object functions are added it would be easier to think of a challenge. I can probably write a 4d to 3d projection function pretty easily but nothing regarding drawing vertices, edges and faces... Should we tell him to wait off till that's done or can you think of an idea which can use the library in it's current state?

@max0410
Copy link
Contributor

max0410 commented Feb 19, 2017

I don't think it would be problem if we held off on it for a bit, he does already have a lot of suggestions.

@Smilebags
Copy link
Owner Author

Yeah lets get things a bit more polished off first.

@shiffman
Copy link

Yes, no hurry, I've got a big backlog of this to do! A challenge idea (keeping it as simple as possible) would be great!

@max0410
Copy link
Contributor

max0410 commented Feb 19, 2017

Ok, no problem @shiffman!

@Smilebags
Copy link
Owner Author

Well that was difficult, but I managed to set down a good base in order to work out the other stuff we will need more easily in this commit 00016d5

@Smilebags
Copy link
Owner Author

@max0410

@max0410
Copy link
Contributor

max0410 commented Mar 2, 2017

Good job! So now we have it all configured to typescript now?

@max0410
Copy link
Contributor

max0410 commented Mar 2, 2017

Oh, nevermind that ^, I looked at the wrong edit.

@Smilebags
Copy link
Owner Author

Yeah, everything is working in TS, and compiles down to a compatible version of the JS library. Should we release 1.1?

@max0410
Copy link
Contributor

max0410 commented Mar 2, 2017

Oh, nice! I guess, you could release 1.1. But I wouldn't really concern myself with version numbers.

@Smilebags
Copy link
Owner Author

I just think it is a good way to track changes and to make sure anyone using it can be sure what versions can be used without changing their code. I'll merge the branch and release 1.1

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

No branches or pull requests

3 participants