Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7543059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:19:46+00:00 2026-05-30T08:19:46+00:00

I have rendered model in ThreeJS. Now, I need to add some interactivity so

  • 0

I have rendered model in ThreeJS. Now, I need to add some interactivity so that:

  1. Depending on user entered values I need to color some parts of the model.
  2. If I click on any model part I want it to be highlighted.

I am new to ThreeJS and a little confused. How do I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:19:47+00:00Added an answer on May 30, 2026 at 8:19 am
    1. If you want to update parts of the model, you need to have a look at textures & materials examples.
    2. When you click the model do you want the whole model to be highlighted or just the face currently under the mouse ? Either way, since you’re working in 3D you will need to create a vector for the mouse position which you’d unproject based on the camera’s projection matrix and using the camera’s position shoot a ray in depth in your 3d scene to see which object(s) intersect it. Luckily the code’s already in many samples like canvas_interactive_cubes:

    In init():

    document.addEventListener( 'mousedown', onDocumentMouseDown, false );
    

    and:

    function onDocumentMouseDown( event ) {
    
                    event.preventDefault();
    
                    var vector = new THREE.Vector3( ( event.clientX / window.innerWidth ) * 2 - 1, - ( event.clientY / window.innerHeight ) * 2 + 1, 0.5 );
                    projector.unprojectVector( vector, camera );
    
                    var ray = new THREE.Ray( camera.position, vector.subSelf( camera.position ).normalize() );
    
                    var intersects = ray.intersectObjects( objects );
    
                    if ( intersects.length > 0 ) {
    
                        intersects[ 0 ].object.material.color.setHex( Math.random() * 0xffffff );
    
                        var particle = new THREE.Particle( particleMaterial );
                        particle.position = intersects[ 0 ].point;
                        particle.scale.x = particle.scale.y = 8;
                        scene.add( particle );
    
                    }
    
                    /*
                    // Parse all the faces
                    for ( var i in intersects ) {
    
                        intersects[ i ].face.material[ 0 ].color.setHex( Math.random() * 0xffffff | 0x80000000 );
    
                    }
                    */
                }
    

    I recommend starting from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A have a ListView that is rendered with multiple items. Now I want to
When I have a Model or ViewModel with values that are sent from the
The Screen-to-world problem on the iPhon e I have a 3D model (CUBE) rendered
I have some squares s of size 15px rendered on a page. Their absolute
Suppose I have an action that returns an rendered asp.net mvc control and send
I have created styled a ListBox in WPF so that it is rendered as
The default MVVP I have seen has multiple ViewModel objects that are rendered through
I have declared my model classes as found in this link ....I now want
I have a basic PageView model that tracks when a particular page is opened.
I have a Textbox rendered by an HtmlHelper <%= Html.TextBox(CategoryTitle,Model.CategoryTitle) %> I post to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.