Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2006
    Location
    Lubbock, Texas
    Posts
    345

    Hit a wall on Lee's Terrain R&D

    I don't suppose someone could help me out here. I've hit a wall at

    36 - Lee's Terrain R&D, Session 2, Pt. 4

    I think I have a math error in defining the patch offset but I cannot for the life of me find it. My patches are coming in but they are offsetting from each other only by a small amount. Here is a picture:

    Click image for larger version. 

Name:	Fail.jpg 
Views:	67 
Size:	1.03 MB 
ID:	71637

    Is it possible that this is being caused by something other than a bad offset? Any help would be appreciated. Thank you.

    David

    EDIT:
    Code:
    Solved; code no longer needed :D
    Last edited by fatgav; 05-02-2011 at 11:39 AM.
    I USED the search function and couldn't find what I needed!

  2. #2
    Join Date
    Jan 2011
    Posts
    72
    I think you'll have to upload your source files so any of us can take a look at it, looking at the picture the offset would be a good explanation, without any code we can't see what really is going on here
    ''A person who never made a mistake never tried anything new.'' - Albert Einstein
    "The expression of what you are in space-time creates the pattern of space time." - Bachir Boumaaza

  3. #3
    Join Date
    Jun 2006
    Location
    Lubbock, Texas
    Posts
    345
    diedy,

    I edited my main post with the TerrainPatch and TerrainDemo code.

    David
    I USED the search function and couldn't find what I needed!

  4. #4
    Join Date
    Sep 2008
    Location
    Salisbury, UK
    Posts
    2,812
    OK, got it... replace

    Code:
    public TerrainPatch(Vector3 pos)
            {
                if (Patches == null)
                    Patches = new List<TerrainPatch>();
                position = pos;
    with

    Code:
    public TerrainPatch(Vector3 pos)
            {
                if (Patches == null)
                    Patches = new List<TerrainPatch>();
                Position = pos;
    You need to set the Position property in order for the setter code to be used... by setting the position field directly, you bypassed the code that multiplies in the spacing.

    I found
    my current avatar on google, so props to THIS GUY who created the original...

  5. #5
    Join Date
    Jan 2010
    Location
    Buenos Aires, Argentina
    Posts
    148
    If what gavs said didn't work try whit this at UpdateMesh()

    Code:
    meshObject.renderer.sharedMaterial = material;
    instead of:

    Code:
    meshObject.renderer.material = material;

  6. #6
    Join Date
    Jun 2006
    Location
    Lubbock, Texas
    Posts
    345
    Fatgav,

    Dude! You rock. I knew this was going to be something just that easy. I even had trouble trying to see what you had replaced. Had to look at it for a long time before I picked up the casing of "p".

    Anyway, I really appreciate your help.

    David
    I USED the search function and couldn't find what I needed!

  7. #7
    Join Date
    Sep 2008
    Location
    Salisbury, UK
    Posts
    2,812
    Glad to be of help.

    btw, I removed the code from your first post now that we've found the problem.

    Cheers, G.

    I found
    my current avatar on google, so props to THIS GUY who created the original...

  8. #8
    Join Date
    Jun 2006
    Location
    Lubbock, Texas
    Posts
    345
    fatgav,

    btw, I removed the code from your first post now that we've found the problem.
    I was wondering about this. I just want to be clear in my mind so I will just go ahead and ask: Is it OK to post full sections of code throughout the MMO class when I (or other students) need help?

    Are there restrictions on posting code relative to a student needing help? If so, is there a good reference post on any such rules or stipulations?

    Forgive me if all this has been answered already but I figured, since the subject presented itself, I would just go ahead and ask so I can be clear.

    Thank you agin for your help. Now I can go get stuck on something else.

    David
    I USED the search function and couldn't find what I needed!

  9. #9
    Join Date
    Sep 2008
    Location
    Salisbury, UK
    Posts
    2,812
    This is one of those areas where a blanket rule gets tricky... Obviously, we want to keep posted code to a minimum but, equally, it's difficult to get help with debugging if no-one else can see the code

    However; it's not like you just said "My code doesn't work!" and posted your entire code (seriously; it happens...); you made an educated guess as to where the problem was and posted the code you thought relevant. This is, in my view, exactly the right thing to do... which is why I took the time to look for the problem. Now that we found the problem, there's no longer a need for the code to be there, so I took it back out.

    I found
    my current avatar on google, so props to THIS GUY who created the original...

  10. #10
    Join Date
    Jun 2006
    Location
    Lubbock, Texas
    Posts
    345
    That sounds good fatgav. I'll just keep on doing it like that.
    I USED the search function and couldn't find what I needed!

Posting Permissions

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