Scale down objects

I want to scale down the moving objects and make them on top the spinning cube.
I also want to add 2 more objects but when I trying I get error “sphere is undefined”
Here is link
http://noganagarut.com/new/spin/one-spin.html

I manage to work it but not so perfect.
I still getting error when I adding the third object.
“window 1” line (line 69) is the third object.
//scene.add(mesh_window1); (line 74) cause the error

The parameter order of the Mesh constructor is as follows: Mesh( geometry, material ). In your code, you create mesh_window1 like so:

mesh_window1 = new THREE.Mesh(material_window1, geometry_window1);

As you can see, your order is reversed.

Thanks, I copy-paste code that work and it fix it.
There is way to use png file with transparency ?
The image on the bottom-right have transparency but it show as black.

Try this: material_window2.alphaTest = 0.5.

The object is still handled as opaque but the alpha test ensures to discard all fragments with a lower alpha value than 0.5. In this way, you create so called alpha-cutouts.

Thanks, it work nice.
transparency can work also with the spinning object? I want to have some kind of roof ?
it is not Cone, it is more like Cube with different look at each side. I found how to show different images on each side

I manage to build this
http://noganagarut.com/new/spin/‏‏one-spin-with-boxes.html
The problem is the images work right for the first time but after that something is wrong.
I also want to add shadow under the spinning cube, how I add shadow?

Such question were already asked multiple times. I suggest you take your time and look at the forum and stackoverflow for related threads. The examples are also a good place for beginners. For instance the following demo demonstrate the usage of shadow mapping:

https://threejs.org/examples/webgl_shadowmap

Thanks, hope it will help. the people on stackoverflow are sometimes not nice, they down vote question instead of helping

Well, sometimes it’s actually the quality of the questions that need to be improved. But yeah, helping people is more time intensive than just down voting a question.

2 Likes

I have problem with the timing, after the first time the movement is not working right
http://noganagarut.com/new/spin/‏‏one-spin-with-boxes.html
Why this happen?

I’m not sure I understand your issue. What do you mean with “not working right”? Please be more specific and describe the expected and actual result in detail.

I manage to fix it, the problem was that the moving images do not move right after the first circle.
this is the fixed: http://noganagarut.com/new/spin/greenboxes.html
Now I trying to move all 4 images on the same time