Results 1 to 2 of 2
  1. #1
    mafzal is offline Member
    Join Date
    Jun 2011
    Stuttgart, Germany
    Rep Power

    Default java3D and external text file

    I am new to java3D. I have to design 3D space which contains multiple triangles. I have a text file with coordinates of triangle vertices and one additional parameter which will contain information about temp. First thing I have to do is to design 3D space reading from external text file and then after evaluating the temp parameter I have to set the temp color for each triangle. My text file is in this format.


    -8.55043646703429, -25, 23.4923399478045

    -8.20841900835292, -25, 22.5526463498923

    -8.55043646703429, -24, 23.4923399478045


    -8.20841900835292, -25, 22.5526463498923

    -8.55043646703429, -24, 23.4923399478045

    -8.20841900835292, -24, 22.5526463498923


    I don't know how I can read text file and using that information how I can draw 3D space. I can draw simple 3D space with 2,3 triangles by giving information about the coordinates of triangle manually and same for color information.

    Any example or material will really help me.


  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    how I can read text file
    For a simple file reader you could use the Scanner class to read the file line by line. Then separate the data fields and convert the Strings to double with the Double class.

Similar Threads

  1. Reading file external to jar file
    By nn12 in forum New To Java
    Replies: 6
    Last Post: 02-04-2011, 06:46 AM
  2. Including external file in JSP
    By ulix83 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 05-10-2010, 11:31 AM
  3. Reading external text files from an Applet
    By Arnold in forum New To Java
    Replies: 2
    Last Post: 01-07-2010, 07:43 PM
  4. Need help with eclipse 3.4 and external jar file
    By point_Base in forum Eclipse
    Replies: 11
    Last Post: 09-11-2009, 02:48 PM
  5. Use a external file in my program
    By romina in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts