Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Raycasting Wall Texturing

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Raycasting Wall Texturing

    I have the engine working, and right now, the walls are solid colors. How would I go about slicing 64x64 textures to render onto the walls?

    This is the code for rendering walls, it should be all you need to get the gist of drawing one kind of texture on all walls:

    g.fillRect(sliceColumn, wallTop, 5(SliceWidth), wallHeight);

    You only have to give me a basic outline of how to render one type of texture on ALL walls, if you can help me do the slicing, I can do the individual wall texturing. Unless you want to help me with that part too, haha.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Raycasting Wall Texturing

    Is there any java programming you need help with?

  3. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Raycasting Wall Texturing

    I posted this in theory and questions. This is leaning more on theory.

    I need help on splitting 64x64 images into strips that fit onto the strips of wall I render in raycasting. I just can't do this, because I don't know how to efficiently go about splitting the images. I need a command that can use doubles, but most of buffered image commands use ints. Rendering them virtually useless to my cause.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Raycasting Wall Texturing

    I have never understood how you can extract 11.23 pixels from an image. Or change the pixel at x=23.5, y=33.4

    have you looked in the Java tutorial to see if there are any topics there of interest.
    Perhaps Java2D. Go to this site and have a look:
    The Really Big Index

  5. #5
    Junior Member
    Join Date
    Aug 2011
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Raycasting Wall Texturing

    Quote Originally Posted by Norm View Post
    I have never understood how you can extract 11.23 pixels from an image. Or change the pixel at x=23.5, y=33.4

    have you looked in the Java tutorial to see if there are any topics there of interest.
    Perhaps Java2D. Go to this site and have a look:
    The Really Big Index
    Thanks, but I may just try another website. I've never really like the way java tutorials explains things. Don't get me wrong though, I am thankful for the assistance you have given me!

  6. #6
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Raycasting Wall Texturing

    Round your doubles to the nearest integer and then use the BufferedImage API.

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Raycasting Wall Texturing

    I guess some students need their hand held a bit more. One of the things you need to learn is how to use the existing documentation.

Similar Threads

  1. Make brick wall using BlueJ
    By boumasmoud in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 3rd, 2011, 04:32 PM
  2. Increase heap size; 4 GB wall?
    By BKB in forum What's Wrong With My Code?
    Replies: 4
    Last Post: July 13th, 2010, 08:55 PM
  3. Simple java program to calculate wall covering of a room
    By parvez07 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: August 22nd, 2009, 03:31 PM