p5.dimensions.js
p5.dimensions.js copied to clipboard
nObject class and functions for it.
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.
@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.
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.
I added nShift #23
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.
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.
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.
^^
No, no, no! He would just make a video about it! He wouldn't be making a cool project out of it, not contributing.
I guess I just though you'd like to know.
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.
Ok!
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?
I have a feeling some sort of import should work but I just don't know how to get it to work.
To tell the truth I don't know much about TS. I'll research it.
Me too! high-5 I know it is worth using for larger projects but I've only really dabbled in the basics of it.
Do you really get any errors just by renaming the file? Probably some warnings, but I don''t see why there would be errors.
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!
TypeScript Errors are more picky than JavaScript ones. For example every p5.prototype.something line gives an error saying "Cannot find name 'p5'."
It still compiles, if you allow it to, but it isn't clean TypeScript.
Thanks! I look forward to his reply.
Ah
About, the nD viewer idea. Here is a site about 4d visualizations: http://www.math.union.edu/~dpvc/math/4d/models/welcome.html
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!
I'll look in to their code.
I got a response from @shiffman! He told me to make an issue in his channel repo.
Though I need to give him some topic or challenge around our library, any suggestions?
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?
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.
Yeah lets get things a bit more polished off first.
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!