p5.dimensions.js icon indicating copy to clipboard operation
p5.dimensions.js copied to clipboard

nObject class and functions for it.

Open Smilebags opened this issue 8 years ago • 38 comments

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 avatar Feb 16 '17 07:02 Smilebags

@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.

Smilebags avatar Feb 16 '17 07:02 Smilebags

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 avatar Feb 17 '17 02:02 max0410

I added nShift #23

max0410 avatar Feb 17 '17 02:02 max0410

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.

Smilebags avatar Feb 17 '17 03:02 Smilebags

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.

max0410 avatar Feb 18 '17 00:02 max0410

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 avatar Feb 18 '17 00:02 Smilebags

image ^^

Smilebags avatar Feb 18 '17 00:02 Smilebags

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 avatar Feb 18 '17 01:02 max0410

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

max0410 avatar Feb 18 '17 01:02 max0410

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.

Smilebags avatar Feb 18 '17 01:02 Smilebags

Ok!

max0410 avatar Feb 18 '17 01:02 max0410

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 avatar Feb 18 '17 01:02 Smilebags

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

Smilebags avatar Feb 18 '17 01:02 Smilebags

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

max0410 avatar Feb 18 '17 01:02 max0410

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

Smilebags avatar Feb 18 '17 01:02 Smilebags

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 avatar Feb 18 '17 01:02 max0410

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!

max0410 avatar Feb 18 '17 01:02 max0410

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

Smilebags avatar Feb 18 '17 01:02 Smilebags

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

Smilebags avatar Feb 18 '17 01:02 Smilebags

Thanks! I look forward to his reply.

Smilebags avatar Feb 18 '17 01:02 Smilebags

Ah

max0410 avatar Feb 18 '17 01:02 max0410

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

max0410 avatar Feb 18 '17 01:02 max0410

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!

Smilebags avatar Feb 18 '17 01:02 Smilebags

I'll look in to their code.

max0410 avatar Feb 18 '17 01:02 max0410

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

max0410 avatar Feb 18 '17 22:02 max0410

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

max0410 avatar Feb 18 '17 22:02 max0410

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?

Smilebags avatar Feb 18 '17 22:02 Smilebags

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.

max0410 avatar Feb 19 '17 03:02 max0410

Yeah lets get things a bit more polished off first.

Smilebags avatar Feb 19 '17 03:02 Smilebags

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!

shiffman avatar Feb 19 '17 14:02 shiffman