• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

facing problem while creating a Road/Pathway using Java3D

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys,

I am newbie in Java3D and I am facing some problems while designing a 3d shape. Actually I have to design a 3d shape of a 'Carpet' placed on the ground in such a way, it looks like a Road or Pathway from "First-Person-View". That is, like a Trapezoid. The Carpet itself is made up of several segments or pieces, each of different color, width and height. Finally, exporting the final Carpet-shape as Buffered Image. Though I am able to do the later part very easily, that is, creating an image using BufferdImage from JFrame, On & Off Screen Canvas but the designing part is where I am facing some difficulties.

I am creating a Group (carpetShapeGroup) of Polygons (with QuadArray: 4) for each segment/piece and place them one over another. so it looks like Rectangular Boxes placed one over another. Then with the Transformation3D (rot), I rotate this carpetShapeGroup with rot.rotX(-Math.PI/4) to make it like a Trapezoid shape. However, I am able to draw the image but there are several problems which I am not able to solve anymore and I need some help. I had uploaded the code on Pastie and attached it here as well with inline comments to illustrate the details. Following are the problems I am facing;

1. I can create a Carpet with 3 segments/pieces successfully but as soon as I add fourth segment, the image gets distorted and the segments overlaps each other. I don't know why is it happening and how to resolve this issue. (Uncomment line:227)

2. In order to display the Carpet from the bottom of the Screen i am setting a constant factor (*Transformation_Vector_Y*) but I am not able to derive it as Constant for different screen resolutions. I mean I had to make slight changes in Transformation_Vector_Y each time the Screen width and height is modified. (line:132)

Please let me know if something is unclear here, I will try to explain my problem again. Looking forward to see your replies.

thanks and regards


 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
 
Haris Farooque
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Darryl Burke wrote:Haris, please BeForthrightWhenCrossPostingToOtherSites

http://www.manning-sandbox.com/thread.jspa?messageID=117449
http://stackoverflow.com/questions/7158811/facing-problem-while-creating-a-road-pathway-in-java3d
https://forums.oracle.com/forums/thread.jspa?messageID=9819567



I posted to other forums but I didn't get any reply. I believe the problem i have posted has a fairly simple answer but somehow I don't know why I didn't get any replies. i would appreciate if people on CodeRanch could help me.
 
reply
    Bookmark Topic Watch Topic
  • New Topic