[R+D] Best place to mark roads in your meshes? menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [R+D] Best place to mark roads in your meshes?

    All-

    So for those that have marked roads differently (I'm manually running the route + recording positions), how have you done this? I'm attempting to do it between rcMarkWalkableTriangles and rcRasterizeTriangles and I'm thinking that might not be the best place.

    Basically if any vertice of the triangle touches the road, I mark the entire triangle as "ROAD". I'm pretty certain I shouldn't do this, and my tests after doing this don't show it preferring roads over ground (1 vs 5 weight).

    My implementation:

    Code:
    	rcMarkWalkableTriangles(_ctx, m_cfg.walkableSlopeAngle, verts, nverts, tris, ntris, m_triareas);
        
        
        NSArray *AllRoads = [[MeshDataController sharedInstance] roadsForContinent:530];
    
        // 44,12 continent: 530
        if ( [AllRoads count] > 0 ){
        
            for (int i = 0; i < ntris; ++i)
            {
                const int* tri = &tris[i*3];
                
                // vertices that make up the triangle!
                glm::vec3 v1 = glm::vec3(verts[tri[0]*3+0], verts[tri[0]*3+1], verts[tri[0]*3+2]);
                glm::vec3 v2 = glm::vec3(verts[tri[1]*3+0], verts[tri[1]*3+1], verts[tri[1]*3+2]);
                glm::vec3 v3 = glm::vec3(verts[tri[2]*3+0], verts[tri[2]*3+1], verts[tri[2]*3+2]);
                
                // ADT        In Game
                // centerX = -1 * pg.Y
                // centerY = pg.Z
                // centerZ = -1 * pg.X;
                
                for ( NSArray *road in AllRoads )
                {
                
                    // Single mob scan
                    for ( int j = 0; j < [road count] - 1; j = j + 2 )
                    {
                        ObjectPosition *p1 = [road objectAtIndex:j];
                        ObjectPosition *p2 = [road objectAtIndex:j+1];
                        
                        glm::vec3 Point1 = glm::vec3(p1.xPositionADT, p1.yPositionADT, p1.zPositionADT);
                        glm::vec3 Point2 = glm::vec3(p2.xPositionADT, p2.yPositionADT, p2.zPositionADT);
                        
                        GfxMath::LineSegment2f LS(Point1, Point2);
                        
                        float distance = 1.0f;
                        if ( LS.distance(v1) < distance || LS.distance(v2) < distance || LS.distance(v3) < distance )
                        {
                            m_triareas[i] = SAMPLE_POLYAREA_ROAD;
                        }
                    }
                }
            }
        }
        
        rcRasterizeTriangles(_ctx, verts, nverts, tris, m_triareas, ntris, *m_solid, m_cfg.walkableClimb);
    Anyone have any ideas on how else I should do this?

    Thanks!
    ~ Tanaris
    https://tanaris4.com

    [R+D] Best place to mark roads in your meshes?
  2. #2
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would have done it sooner :
    for me you should mark it directly in the inputGeometry object so before starting the whole meshcreation process.:

    Wheck how recastDemo is creating Grass/water vertices.

  3. #3
    EvsonRARA's Avatar Member
    Reputation
    2
    Join Date
    Dec 2007
    Posts
    22
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was expecting C# for a second and realized, oh forgot about tan and his pocketgnome. You should really make a wrapper for that, it's really unappealing for ObjC. You'll thank me later.

  4. #4
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can miss c++ and Obj-C quite easily though, so you don't need a wrapper
    https://tanaris4.com

Similar Threads

  1. Best place to sell account?
    By vinnypwns in forum World of Warcraft General
    Replies: 4
    Last Post: 05-16-2007, 12:49 PM
  2. Best place to sell gold?
    By ajwizkid in forum World of Warcraft General
    Replies: 0
    Last Post: 04-28-2007, 02:00 PM
  3. Best place for an alliance 54 mage to grind?
    By skillzz in forum World of Warcraft General
    Replies: 2
    Last Post: 02-11-2007, 07:17 PM
  4. Where is the best place to sell an account?
    By kakaio in forum Community Chat
    Replies: 1
    Last Post: 01-21-2007, 06:05 PM
  5. Best place for Mithril? or Gathereer profiles?
    By lsybarra in forum World of Warcraft Guides
    Replies: 1
    Last Post: 11-23-2006, 03:58 AM
All times are GMT -5. The time now is 01:37 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search