Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Apr 2007
Offline Last Active Private

#5262688 Visual Studio includes a 3d modeller!

Posted by lucky6969b on 18 November 2015 - 10:56 PM

Guess what.
The visual studio 2013 community already got a 3d modeller built-in
I don't even need to pay for a 3d asset converter and anything like that.
It is as easy as that

Attached Thumbnails

  • 2015_11_19_12_53_06_Operator2.FBX_Microsoft_Visual_Studio.png

#5256144 Map/Hash a range of D3DXVECTOR3 into a grid space?

Posted by lucky6969b on 07 October 2015 - 10:20 PM

I am puzzled where the unordered_map should be sparsed and a range of D3DXVECTOR3 should map
into this space.
But this statement just won't work

// this thing doesn't work
tileMap.insert(ptVec.begin(), ptVec.end());

#include "stdafx.h"
#include <d3dx9.h>
#include "NavmeshSingleton.h"
#include "navmesher.h"
#include <boost/functional/hash.hpp>
#include <unordered_map>
#include <iostream>

using namespace std;

struct cPoint {
    cPoint() { }
    cPoint(const cPoint& other) {
        this->id = other.id;
        this->x = other.x;
        this->z = other.z;
        this->vec3 = other.vec3;
    cPoint(const QuadNode& other) {
        this->id = other.Index;
        this->x = other.x;
        this->z = other.z;        

    int id;
    int x;
    int z;
    D3DXVECTOR3 vec3;

struct D3DXVec3KeyHasher {
    std::size_t operator()(const D3DXVECTOR3 &vec3) const
        std::size_t seed = 0;
        //boost::hash_combine(seed, x.from);
        //boost::hash_combine(seed, x.to);
        float fXInc = NavmeshSingleton::GetNavMesher()->GetXInc();
        float fZInc = NavmeshSingleton::GetNavMesher()->GetZInc();

        const D3DXVECTOR3& bmin = NavmeshSingleton::GetNavMesher()->GetMin();
        const D3DXVECTOR3& bmax = NavmeshSingleton::GetNavMesher()->GetMax();

        // -30 - (-30) / 10 = 0
        // -29 - (-30) / 10 = 0.1xx =>floor => 0

        int newX = std::floor((vec3.x - bmin.x) / fXInc);
        int newZ = std::floor((bmin.z - vec3.z) / fZInc);

        boost::hash_combine(seed, newX);
        boost::hash_combine(seed, newZ);

        return seed;

int _tmain(int argc, _TCHAR* argv[])
    std::unordered_map<D3DXVECTOR3, cPoint*, D3DXVec3KeyHasher> tileMap;
    std::vector<QuadNode*> walkables = NavmeshSingleton::GetNavMesher()->GetWalkables();    

    std::vector<cPoint*> ptVec;
    for (auto& w : walkables) {        
        cPoint* pt = new cPoint(*w);
        // this thing doesn't work
    tileMap.insert(ptVec.begin(), ptVec.end());

    for (auto& t : tileMap) {
        cout << "t x:" << t.second->x << " z:" << t.second->z << endl;

    // Test hashing
    D3DXVECTOR3 testVec3;
    testVec3.x = 0;
    testVec3.z = 0;

    cPoint* pt = tileMap[testVec3];

    cout << "pt x:" << pt->x << " z:" << pt->z << endl;

    return 0;

#5238306 How to run a DX8 application on windows 7 64-bit

Posted by lucky6969b on 03 July 2015 - 10:53 PM

Yes, the IDE does work on windows 7, choose compatibility option and make it compatible with XP Service Pack 2 or up.

All of the programs work normally under this environment without problems.

Do you know where can I get those activex dlls?



#5233786 CMake for ogitor

Posted by lucky6969b on 09 June 2015 - 07:11 AM



I think I must follow this route... Try that tomorrow, have to go now.



#5231610 Getting move back direction from an orientation matrix?

Posted by lucky6969b on 29 May 2015 - 01:02 AM

Thanks man

#5202549 How should I stop this animation set?

Posted by lucky6969b on 07 January 2015 - 04:31 AM

I've solved my own problem, it is because of I have to keep track of the local time for each truck instead of

the global time.

#5179783 Can concave polygons be used in pathfinding?

Posted by lucky6969b on 12 September 2014 - 12:31 AM

Hello Ashaman73,

Thank you for clearing up my doubts,

I asked this question because I suddenly think of this thing that might or might not work.

Originally I have several navmeshes with different radii, I want to use them for cooperative pathfinding as an alternative

to steering.

Now I'd like to calculate the intersection between these navmeshes, if navmesh A, B and C intersect, then they can

cooperatively path find, if just A and B intersect, agent C can ignore the other 2 agents, and A and B can continue

to cooperative pathfind. I've found a library actually which does this, but the caveat is the results may be concave.




How do you call a process which turns a concave poly into a convex poly? Triangulation is not the word?


What is your opinion?



#5179767 Can concave polygons be used in pathfinding?

Posted by lucky6969b on 11 September 2014 - 10:53 PM

My apologies first if I say something silly because I am no graphic expert,

I am just a programmer. Most of the times I heard about the

usages of convex polygons which are plenty.

But can a concave polygon be used in the pathfinding process?

Thanks Jack

#5175776 Direct3D Setting the State of Line Widths and Point Sizes

Posted by lucky6969b on 24 August 2014 - 05:02 AM

Hello, In the Direct3D State Machine,

I wonder how can I set the state of a line width and of a point size?

In the following OpenGL Code Snippet,

it tries to reset the line width and point size of the current OpenGL states,

I wonder how I can do the same in Direct3D?

I've looked at ID3DXLine, but I don't think it is where I am looking for.



void DebugDrawDX::end()

#5171598 Cohesion and coupling

Posted by lucky6969b on 05 August 2014 - 04:46 AM

In my project, I code that in a way that high coupling and low cohesion is not an option. For example, the Create Object method has to know about the Object map and geometry in which they are later used for navigation mesh building process. It seems unavoidable. All the stuff in Create are unrelated. Is it a bad practice? Or it is just unavoidable like I said.
bool Create(std::string name, LPDIRECT3DDEVICE9 pDevice, SkinnedMesh *pMesh, SkinnedMesh* geom, ObjectMap obj, float fAnimSpeed = 1.0f);
Thanks Jack

#5158612 [updated]: Make certain objects arrive in the scene (a lorry)

Posted by lucky6969b on 05 June 2014 - 10:52 PM

Yes, and it would be perfectly nice to post some example code for me.



#5154556 How to make object numbering consistent and sequential?

Posted by lucky6969b on 18 May 2014 - 11:20 PM


1     7
2     8     13     18
3     9     14     19
4    10    15     20
5    11    16     21
6    12    17     22

When I put a point at "1", then drag out "2", then "3" afterwards,
Then I copy and drag 1 to 6 as a bunch of points over to 7 to 12 and so forth,
sometimes the numbers will be out of sequence.
Are there any plugins or techniques that will keep the numbering sequential
So I don't loose them because I want to use them as spatial anchors/tags/place holders what you call it when I export them to the game engine.

#5148673 Can you quickly visualize how a quaternion would look on top of your head?

Posted by lucky6969b on 22 April 2014 - 02:38 AM

If you see a quaternion of a certain value, can you quickly determine how this orientation would look on top of your head? If you can, how can you do that handily? Thanks Jack

#5146858 A General Recast/Detour Question

Posted by lucky6969b on 14 April 2014 - 04:18 AM

Yes, actually I found out that m_npolys returns the total number of steps as a final result. Thanks for helping. Jack

#5146848 A General Recast/Detour Question

Posted by lucky6969b on 14 April 2014 - 03:08 AM

Hello, When findPath of dtNavMeshQuery returns, it fills up one of the m_smoothpath or m_straightpath buffers. But how can you tell how many steps are there inside the buffers? Thanks Jack