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 9180657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:06:34+00:00 2026-06-17T18:06:34+00:00

This is part of code that’s supposed to draw 2 cubes of side 0.3

  • 0

This is part of code that’s supposed to draw 2 cubes of side 0.3 next to each other
When I get instead is this: http://imageshack.us/photo/my-images/189/89254345.png/
(they are halfway into each other) I tried printing the transforms and they look alright:

1

1.0, 0.0, 0.0, 0.0

0.0, 1.0, 0.0, 0.0

0.0, 0.0, 1.0, 0.0

0.0, 0.0, 0.0, 1.0

2

1.0, 0.0, 0.0, 0.3

0.0, 1.0, 0.0, 0.0

0.0, 0.0, 1.0, 0.0

0.0, 0.0, 0.0, 1.0

It’s as if the second box was only moved by 0.15 but if I multiply dx by 2 things break when more cuboids of different dimensions get added with transforms across the y or z axis

private BranchGroup rootGroup;

public void addBox(float dx){
    Cuboid Cuboid1 = new Cuboid(0.3f ,0.3f, 0.3f, appearence); 
    TransformGroup tg = new TransformGroup();
Transform3D transform = new Transform3D();
    Vector3f vector = new Vector3f(dx, 0f, 0f);
    transform.setTranslation(vector);
    tg.setTransform(transform);
    tg.addChild(Cuboid1);
    rootGroup.addChild(tg);
}

public void addBoxes(){
    for(int i=0;i<2;i++){
        addBox(i*0.3f);
    }
}

The cuboid class is from here: http://www.java2s.com/Code/Java/3D/Java3DBoxandacustomCuboidimplementation.htm

  • 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-17T18:06:35+00:00Added an answer on June 17, 2026 at 6:06 pm

    It looks like you’re creating a cuboid which is 0.6 in size so it will have +0.3 and -0.3 X,Y,Z values for the first box as the center point of the cuboid is 0,0,0.

    The second box is the same but offset by 0.3 in one axis which gives 0.3-0.3=0.0 and +0.3+0.3 = 0.6 values in one of the axes.

    This will give two boxes that overlap half way on one axis which seems to match your picture.

    Perhaps you mean to create a box with width/height/depth of 0.3/2 and translate it by 0.3/2 so that the center of the box is at 0.15,0.15 and use a scale factor of 0.15 instead of 0.3?

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

Sidebar

Related Questions

It seems that this part of my code is where the exception occurs: c
Does your editor/ide highlight that a++; in this C/C++ code as part of a
.bind('click',function(){ window.open($(this).find('.pc_more').html()); }); }); is there something in this part of the code that
I have this part of code that takes a file and puts it in
I have this part of code that was compiling using ARMASM : /* Software
I have this part of code in my functions.php: function cc_admin_enqueue_scripts($hook) { $file_dir=get_bloginfo('template_directory'); wp_enqueue_script('media-upload');
I am trying to learn and writting this part of code. while testing few
i have this simple question please. I have this part of code which sets
I'm studying data structures (List, Stack, Queue), and this part of code is confusing
This part of my code works fine: #include <stdio.h> int main(){ //char somestring[3] =

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.