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

Export to Three.js Code #11

Open
zz85 opened this issue Dec 19, 2011 · 10 comments
Open

Export to Three.js Code #11

zz85 opened this issue Dec 19, 2011 · 10 comments

Comments

@zz85
Copy link

zz85 commented Dec 19, 2011

Would it be difficult to implement a javascript code exporter? It could be useful for embedding scene information into another, and allow the code to be further tweak modified by hand.

Btw, looks like lots of nice progress coming along :D

@idflood
Copy link
Owner

idflood commented Dec 19, 2011

I think it's not impossible but clearly not easy to implement. One thing that would make it a lot easier would be to still use the nodes from threenodes instead of creating straight three.js code. What do you think?

@zz85
Copy link
Author

zz85 commented Dec 21, 2011

Do you mean threeNode objects instead of three.js objects? I think doing that should be good too, from threenodes object would also be a good first step to converting to three.js objects by hand compared to interpreting a JSON file.

@idflood
Copy link
Owner

idflood commented Dec 21, 2011

Yes, exactly :)
So this may be a lot easier to do than I first thought.

@zz85
Copy link
Author

zz85 commented Jan 5, 2012

just btw, how difficult do you think to integrate https://github.com/zz85/sparks.js/ ? it could turn out like http://flexmonkey.blogspot.com/2010/03/flex-flint-particles-editor-with-node.html

not sure if i would do it though I could give it a try sometime...

@idflood
Copy link
Owner

idflood commented Jan 5, 2012

It looks relatively easy, at least for basic functionality. This could be fun.

@imgntn
Copy link

imgntn commented Jan 8, 2012

i would LOVE if this could export to three.js code. i'm running a research group this quarter at UC Santa Cruz to create a webGL based netart piece and have several undergraduate engineers/designers working on the project. i think i'd be able to get a lot more out of them if they could prototype in threeNodes. then they can tweak the code as necessary after that, but once we get a few design pattern blocks put together, i think this would be a lot better. i'm already using collaborative solutions like cloud9IDE, etc. second zz85's desire to integrate the sparks.js editor, and i'd like to see the glsl shader playground from mr.doob thrown in there as well... keep us updated!

@idflood
Copy link
Owner

idflood commented Jan 11, 2012

I've added a basic ThreeNodes.js code export under the menu "File -> Export to code".
Here is a live demo created from the code export:
http://idflood.github.com/ThreeNodes.js/public/code_export_example.html

And an example javascript code output:
https://github.com/idflood/ThreeNodes.js/blob/master/public/assets/js/code_export_example.js

These are the next things on my list for this issue:

  • tests
  • animation export
  • switched the default mode to "player" for exported code.

@imgntn
Copy link

imgntn commented Jan 12, 2012

hooray!

@idflood
Copy link
Owner

idflood commented Jan 12, 2012

: )
I've added the animation and switched the view mode to "player". The only missing piece right know is to add tests but I will have to do some little refactoring first and certainly change one line in the exported code.

@zz85
Copy link
Author

zz85 commented Jan 13, 2012

Cool! :)

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

3 participants