Giter Club home page Giter Club logo

Comments (4)

light-matters avatar light-matters commented on May 28, 2024 1

So, it turns out that I can see something if I add in some lighting. Even then though, it's just an edge so really it's better to change the positioning.

So, a few changes 'fixes' the example:

(defn lighting []
  [:object
   [:hemisphere-light {:intensity 0.4
                       :sky-color 0x8890FF
                       :position [0 5 10]}]])

(defn root []
  [:object {:position [0.0 0.0 -5.0]
            :rotation [0 (js/Math.sin (:ticks @state)) 0]}
   [color-box "red" 1.0]
   [growing-sphere]
   [lighting]])

As far as I can tell, this shouldn't be limited to my particular use case and I only started the issue here because this is really just following the examples in the doc. I'd be happy to help add some more content to the examples to avoid potential confusion for others?

from threeagent.

DougHamil avatar DougHamil commented on May 28, 2024

You're absolutely right, the example code is no good without lighting added. Thank you for reporting this, I'd be happy to accept a PR for any doc changes!

from threeagent.

tlonist-sang avatar tlonist-sang commented on May 28, 2024

@DougHamil
Thanks for the great work. I have a question regarding black canvas as well.

From the example source code (https://github.com/DougHamil/threeagent-examples/tree/master/tetris) I found
.setClearColor renderer 0xCCCCFF))

which I assume to be the line setting the color of the canvas. Applying this to the current version using re-frame + threeagent, it doesn't seem to work as expected. (in fact, not working at all!)

One thing I didn't do is to require "three" directly into the namespace. Is there any extra configuration for adding this external js library into ns? and is this necessary for using .setClearColor function in the project?

-- self answer
turns out, you need to add ^js (js interop) in between the method you are calling and parameters.
For example,
(.renderer ^js ctx)
instead of
(.renderer ctx)

from threeagent.

light-matters avatar light-matters commented on May 28, 2024

You're absolutely right, the example code is no good without lighting added. Thank you for reporting this, I'd be happy to accept a PR for any doc changes!

Apologies, I was too slow to do anything like a pull request. To completely abuse the system however, (because I can't find your email address) can I invite you to present an introduction to our clojure data science community ? You can find me on the Clojure zulip chat: https://clojurians.zulipchat.com/#narrow/stream/150796-zulip

from threeagent.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.