Comments (4)
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.
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.
@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.
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)
- Error when wrapping root fn
- I can't figure out how to make a transparent sphere HOT 5
- Controls HOT 1
- To be able to access the ref HOT 10
- Maybe adopt (or document) a quil-like workflow of setup, update, draw functions HOT 1
- Garbage Leak? HOT 5
- v1.0 - Doc Updates
- v1.0 - IEntity protocol
- v1.0 - ISystem protocol
- v1.0 - Expose default camera
- v1.0 - Context/Provider mechanism
- form three component? HOT 9
- Threeagent clashes with reagent HOT 1
- Support custom Renderers
- Adding fog to a scene HOT 1
- anonymous fn for local state bug
- :octahedron runtime error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from threeagent.