Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

CraftSceneInator - simple tool for setting up a Craft scene

I’m just sharing simple little projects that save me time.

I can’t count the times I’ve written the code to set up a scene, add an OrbitViewer, and set the colors for the sky and horizon and ground.

It’s not very much code at all, but I just thought it would be nice not to have to write it anymore, so here’s a class that does it all automatically.

Optionally it shows parameter controls for adjusting the environment colors during runtime.

Tagged:

Comments

  • SimeonSimeon Admin Mod
    Posts: 5,759

    Hah that's really cool!

  • Posts: 2,572

    @UberGoober - that’s very neat will add your class to my utilities library. Thanks.

  • Posts: 1,629
    @Simeon thanks!

    Um hey if you can spare a second can you please please tell me if there is syntax for setting and reading the automatic variable buffers in Craft shaders?

    It seems like like the lassssst piece of the puzzle for converting the old mesh shaders into craft shaders.

    (https://codea.io/talk/discussion/11851/buffers-in-craft-shaders)
  • Posts: 2,572

    @Simeon - just loaded up 3.5 and tried to run CraftSceneInator() from @UberGoober. First thing I find 3.5 a little slow, and with CraftSceneInator() it throws up an initial error relating to the assert() command which carries a parameter in addition to the comment. Followed by an error relating to no Craft.scene available. Commenting out the assert line runs the code correctly. Also after restarting the Codea the speed of operation had increased and was smoother.

  • Posts: 1,629

    @Bri_G thanks for helping!!

    Can you tell me how to reproduce this—I’m not getting any error?

    Do I need to change my code?

  • Posts: 2,572

    @UberGoober - have you installed 3.5 yet ?

  • dave1707dave1707 Mod
    edited December 2021 Posts: 9,806

    @Bri_G I ran CraftSceneInator. I get the Cameras error even though Cameras is checked as a dependency. If I comment out the assert line, it run OK. I’m on 3.5 . Not sure what it’s really supposed to do, but I don’t get any errors.

  • Posts: 2,572

    @dave1707 - good, you confirmed the dependecy issue. The slowness appeared after 3.5 installation, literally first run. After that it was fine in terms of speed. I may need to download the original again to check in case I made any changes. Thanks.

  • Posts: 1,629
    @dave1707 it just saves some steps in creating a scene with an OrbitViewer and having it not just be a black void.
Sign In or Register to comment.