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

colors #3

Open
blonkm opened this issue Apr 26, 2015 · 5 comments
Open

colors #3

blonkm opened this issue Apr 26, 2015 · 5 comments

Comments

@blonkm
Copy link

blonkm commented Apr 26, 2015

I am trying to get a regular cube, but the colors are gradients. Is there a way to view a solid cube?

@travisby
Copy link
Owner

Hey @blonkm,

Let me take a look tomorrow. It's been a while since I've played with this project. I'll see what we can do to make the color configurable.

@JacobLeach
Copy link
Collaborator

@travisby I believe it is just the shader / light that causes this effect. I think the cubes are solid otherwise.

@JacobLeach
Copy link
Collaborator

@blonkm I believe if you just remove the lights from: https://github.com/travisby/RubiksCubeGraphics/blob/master/js/onload.js

aka remove lines 19-23:

light = new Light();
light.setPosition(100,100,100,0);
light.setSpecular(.5,.5,.5,1);
light.setDiffuse(1,1,1,1);
light.setAmbient(1,1,1,.1);

Although you also may need a light for it to work since this is using WebGL. You could try:

light = new Light();
light.setPosition(100,100,100,0);
light.setSpecular(0,0,0,0);
light.setDiffuse(0,0,0,0);
light.setAmbient(1,1,1,.1);

I don't have time right now to try it out but I'm fairly sure that's what is causing the gradients.

@blonkm
Copy link
Author

blonkm commented May 1, 2015

`Well, this is definitely not it. The colors look the same.

@travisby
Copy link
Owner

travisby commented May 1, 2015

@jleach it must be the shaders

@blonkm I'm playing around trying to find a combination of shaders that
looks good. I was able to remove some of the lighting in index.html
(x-shader script tags), and see changes. The light was extremely dark,
however. Trying to get that affect, along with being brighter.

Essentially we want to make colors solid, and switch from positional to
ambient lighting.

Travis Beatty
845-309-9908
[email protected]

On Fri, May 1, 2015 at 5:52 AM, Michiel van der Blonk <
[email protected]> wrote:

`Well, this is definitely not it. The colors look the same.

Reply to this email directly or view it on GitHub
#3 (comment)
.

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