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

  • Home
  • SEARCH
  • 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 8587887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:40:46+00:00 2026-06-11T22:40:46+00:00

I have an article container which has three aside tags inside it. The third

  • 0

I have an article container which has three aside tags inside it. The third aside element id='menuPuzzleType' contains a Three.js script which makes two cube meshes, and renders them in a Canvas renderer.

<article id="popup">

    <aside id='close'><img src="img/close.png" onClick="aFunction()" /></aside>
    <aside id='msgPuzzleType'>Please choose the puzzle type you want to play</aside>
    <aside id='menuPuzzleType'>
        <script>
        function animate() {
            requestAnimationFrame( animate );
            render();
        }

        function render() {
            cube.rotation.y -= 0.03;
            cube2.rotation.y -=0.03;
            renderer2.render(scene2, camera2);
        }
        var container2 = document.getElementById('menuPuzzleType');

        //renderer
        var renderer2 = new THREE.CanvasRenderer();
        renderer2.setSize(400,400);//Was 100,100
        container2.appendChild(renderer2.domElement);

        //Scene
        var scene2 = new THREE.Scene();

        //Camera
        var camera2 = new THREE.PerspectiveCamera(50,50/50,1,1000);
        camera2.position.z = 240;//normal value is 100
        camera2.position.y=60;
        scene2.add(camera2);

        //Axes
        var axes2= new THREE.AxisHelper();

        //Add texture for the cube
        //Use image as texture
        var img2 = new THREE.MeshBasicMaterial({ //CHANGED to MeshBasicMaterial
            map:THREE.ImageUtils.loadTexture('img/2d.png') 
        });
        img2.map.needsUpdate = true; //ADDED

        //Add Cube
        var cube = new THREE.Mesh(new THREE.CubeGeometry(40,40,40),img2);
        cube.position.x =- 60;
        scene2.add(cube);

        var img3 = new THREE.MeshBasicMaterial({ //CHANGED to MeshBasicMaterial
            map:THREE.ImageUtils.loadTexture('img/3d.png') 
        });

        img3.map.needsUpdate = true; //ADDED

        var cube2 = new THREE.Mesh(new THREE.CubeGeometry(40,40,40),img3);
        cube2.position.x = 70; cube.position.y = 60; cube2.position.y=60;
        scene2.add(cube2);
        renderer2.render(scene2,camera2);

        animate();
        </script>
    </aside>
</article>

I need to put the two cubes into the article container tag.

Here is my css code:

body{ overflow:hidden; }

article {
    border:solid 1px #00CC33;
    width:420px;
    height:200px;
    font-family: baskerville; 
    font-size: 16px; 
    margin-top: 50px;

    /*For IE9 compatibility*/
    behavior: url(border-radius.htc);
    border-radius: 8px;
    position:relative;
}

#popup {
    bottom:50%;
    position:relative;
    margin: 0px; 
    left:30%;
}

#msgPuzzleType{ margin-left:60px; }

img{
    behavior: url(border-radius.htc);
    border-radius: 8px;
    position:relative;
}

#menuPuzzleType{
    background-color:#999999;
    border:solid 1px #3300CC;
    height:200px;
}

How can I move two cubes into the article container tag?

  • 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-06-11T22:40:48+00:00Added an answer on June 11, 2026 at 10:40 pm

    A “Three.js” solution to your problem is to do this:

    renderer2.setSize( 400, 150 );
    

    You also have hardwired the aspect ratio of your PerspectiveCamera, so you need to make it match the canvas dimensions.

    var camera2 = new THREE.PerspectiveCamera( 50, 400/150, 1, 1000 );
    

    This will make the canvas smaller so it fits. You then can move the camera closer so your objects are of the size you want.

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

Sidebar

Related Questions

I have hibernate database with three model: Article - which has is part of
I have a large XML file which in the middle contains the following: <ArticleName>Article
I have a Fragment that has contains lots of info (article) with a tabhost
I have model Article it has field title with some text that may contain
Say that I have an article with multiple pages. Each page has a short
I have a navigation menu within a page on my site, which has JavaScript
I've created a usercontrol in asp.net webforms (c#) called 'Article' which contains a general
I have an application which goes out to the internet and collects XML article
I have a div like this <section class=item_container> <article class=item> <h2>Page Title</h2> <p><a class=delete_page
I have a table that contains articles posted by users. The structure of the

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.