Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented May 6, 2025

Related issue: -

Description

The PR improves webgl_instancing_dynamic by introducing a dynamic cube setup with animated colors.

I have not implemented the animation in the shader via TSL on purpose since the demo should showcase the usage of setMatrixAt() and setColorAt().

Comment on lines +163 to +172
// animate camera

camera.position.x = Math.sin( time / 4 ) * 10;
camera.position.z = Math.cos( time / 4 ) * 10;
camera.position.y = 8 + Math.cos( time / 2 ) * 2;

cameraTarget.x = Math.sin( time / 4 ) * - 8;
cameraTarget.z = Math.cos( time / 2 ) * - 8;

camera.lookAt( cameraTarget );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please stop the unnecessary spinning? Keep the camera still. The demo will look very nice without it.

Copy link
Collaborator Author

@Mugen87 Mugen87 May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, the animation makes the demo more exciting. Besides, the previous version of the demo also had an animation. Instead of rotating the entire instanced mesh, the camera is now animated. I would prefer to keep the status quo. Not just because it looks better but also to honor the style of the example's reference from oosmoxiecode.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it that is a "No."

The demo is nauseating to me, so I will have to avoid it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's unfortunate. I do understand your point though and also from a pure functional point of view it's indeed better if examples are static since that makes it easier to compare different versions across releases and spot visual differences.

However, #30695 (comment) outlines why we need more visual appealing demos. And depending on the scene, motion can be a good tool to make 3D scenes more exciting. I feel that's true for webgl_instancing_dynamic.

@Mugen87 Mugen87 added this to the r177 milestone May 7, 2025
@Mugen87 Mugen87 merged commit 6c29a50 into mrdoob:dev May 7, 2025
11 checks passed
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
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

Successfully merging this pull request may close these issues.

2 participants