Jump to content

subabrain

Members
  • Posts

    194
  • Joined

  • Last visited

Posts posted by subabrain

  1. hi there,


    ok i think there are more bugs in the gui - f.e. to delete some elements in the scene, to delete it with the options menu (right click) isnt working ... but the good answer is that it works good with reflection :)

     

    singleton CubemapData( DesertSkyCubemap )
    {
       cubeFace[0] = "./art/skies/Desert_Sky/cubemap/skybox_1.png";
       cubeFace[1] = "./art/skies/Desert_Sky/cubemap/skybox_2.png";
       cubeFace[2] = "./art/skies/Desert_Sky/cubemap/skybox_3.png";
       cubeFace[3] = "./art/skies/Desert_Sky/cubemap/skybox_4.png";
       cubeFace[4] = "./art/skies/Desert_Sky/cubemap/skybox_5.png";
       cubeFace[5] = "./art/skies/Desert_Sky/cubemap/skybox_6.png";
    };

     

    ...


    i did this - thanks a lot!


    Greetz

    Robert

  2. Hello Duion,


    Thanks a lot! I think ill try it with the cubemap - but theres one strange thing.

    If i try to modify the cubemap i cant select the cubemap - its not visible to see the cubemaps - but only with the precompiled version its shown - why that?


    I dont know what to do - maybe you can help me?


    Thanks!


    Greetz

    Robert

  3. Hello together,


    i have a question to you again :P


    So now i try to make a "chrome" effect material on a shape in torque 3d.

    Ive read some things but i dont get the key to work. So i have to use shaders but how can i do that - there is no good tutorial about that.


    Would be nice if you could help me :)


    Thanks a lot!


    Greetings

    Robert

  4. Hi there,


    ok i got it now to work -> it works with wind scale on 0 and some changes of grid size ... further i made a modification on my tutorial, so the brushsize and brushtype will change only one time when start "mowing" ;)


    thanks and have a nice day!


    Greetz

    Robert

  5. Hello,


    sorry for the long delay - i think it has to do with the painting interval. and it paints the groundcover completely new. so i have to reduce the interval - but i need it :/

    Maybe i can reduce the radius of the groundcover (grass) but i think it isnt working ... - maybe you know some way to reduce this "flickering".


    Thank you very much!


    Greetings

    Robert

  6. Hi there,


    its been a long time that i posted here my last post.

    So now its all ok but i have a little question:


    how can i prevent from flickering the grass while painting with this method?


    would be glad to here from you :)



    Thanks a lot -

    Robert

  7. Hi there,


    okay - i think the sorucecode is right now:

     

    #include "mow.h"
    #include "T3D/player.h"
    #include "T3D/gameBase/gameConnection.h"
    #include "gui/worldEditor/terrainEditor.h"
    #include "gui/worldEditor/terrainActions.h"
    #include "console/simBase.h"
    #include "console/console.h"
    #include "terrain/terrData.h"
     
    IMPLEMENT_CONOBJECT(mow);
     
     
    void mow::setTerrainMaterial() {
     
    	//Point3F pos = Point3F(100.0f, 100.0f, 0);
     
    	Point2F pos = Point2F(100.0f, 100.0f);
     
    	TerrainEditor *mTerrainEditor = new TerrainEditor();
     
    	GameConnection* connection = GameConnection::getConnectionToServer();
     
    	Player* playerObject = dynamic_cast< Player* >(connection->getControlObject());
     
    	//Point3F pos = playerObject->getPosition();
     
    	// Fetch the terrain with a ray-trace.
    	TerrainBlock *terrain = mTerrainEditor->getTerrainUnderWorldPoint(Point3F(pos.x, pos.y, 0));
     
    	//Point2F p;
     
    	GridInfo gi;
    	GridPoint gp;
     
    	gp.terrainBlock = terrain;
    	// Z-coordinate is not used
    	gp.gridPos = gp.terrainBlock->getGridPos(Point3F(pos.x, pos.y, 0));
     
    	GridInfo inf;
     
    	U32 mat = 1;
     
    	mTerrainEditor->getGridInfo(gp, gi);
     
    	inf.mMaterialChanged = true;
     
    	inf.mMaterial = mat;
    	mTerrainEditor->setGridInfo(inf, true);
     
    	mTerrainEditor->scheduleMaterialUpdate();
     
    }
     
    DefineEngineMethod(mow, setTerrainMaterial, void, (), , "")
    {
    	object->setTerrainMaterial();
    }

     

    But i always get an exception with the following code:

     

    "**m**" was "0x1CC".

     

    okay - maybe you could help.


    Thanks a lot for all Answers!



    Greetings

    Robert

  8. Hello Guys,


    okay - i get now made some changes with the above code:


    first the "mow.cpp":

     

    #include "mow.h"
    #include "T3D/player.h"
    #include "T3D/gameBase/gameConnection.h"
    #include "gui/worldEditor/terrainEditor.h"
    #include "gui/worldEditor/terrainActions.h"
    #include "console/simBase.h"
    #include "console/console.h"
    #include "terrain/terrData.h"
     
    IMPLEMENT_CONOBJECT(mow);
     
    void mow::setTerrainMaterial()
    {
     
    	Point2F pos = Point2F(10.0f, 10.0f);
     
    	Con::printf("durchlauf");
     
    	U32 mat = 1;
     
    	TerrainEditor *mTerrainEditor = new TerrainEditor();
     
    	// Fetch the terrain with a ray-trace.
    	TerrainBlock *terrain = mTerrainEditor->getTerrainUnderWorldPoint(Point3F(pos.x, pos.y, 1000.0f));
    	F32 squareSize = 2.0;
     
    	Point2F p;
     
    	GridPoint gp;
     
    	gp.terrainBlock = terrain;
    	// Z-coordinate is not used
    	gp.gridPos = gp.terrainBlock->getGridPos(Point3F(pos.x, pos.y, 0));
     
    	GridInfo inf;
    	GridInfo gi;
     
    	mTerrainEditor->getGridInfo(gp, gi);
     
    	// If grid is already set to our material, or it is an
    	// empty grid spot, then skip painting.
    	if (inf.mMaterial == mat || inf.mMaterial == U8_MAX)
     
    	inf.mMaterialChanged = true;
     
    	// Painting is really simple now... set the one mat index.
    	inf.mMaterial = mat;
    	mTerrainEditor->setGridInfo(inf, true);
     
    	mTerrainEditor->scheduleMaterialUpdate();
     
    }
     
    DefineEngineMethod(mow, setTerrainMaterial, void, (), , "")
    {
    	object->setTerrainMaterial();
    }

     

    then the "mow.h":

     

    #include "console/simBase.h"
     
    class mow : public SimObject {
     
    private:
     
    	typedef SimObject Parent;
     
    public:
     
    	mow() { }
     
    	void setTerrainMaterial();
     
    	DECLARE_CONOBJECT(mow);
     
    };

     

    and now i run it with the following code in mow.cs: (first i add it to the scriptExec.cs):

     

    function mowit() {
     
       %obj = new mow();  
       %obj.setTerrainMaterial();
     
    }

     

    okay - now i call the function "mowit" via console in T3D - but it crashes :/


    please help!



    Thank you very much!


    Greetz

    Robert

  9. Hello Again,


    this is now my status:

     

    void TerrainEditor::mow()
    {
    	GameConnection* connection = GameConnection::getConnectionToServer();
     
    	Player* playerObject = dynamic_cast< Player* >(connection->getControlObject());
     
    	Point3F pos = playerObject->getPosition();
     
    	// Fetch the terrain with a ray-trace.
    	TerrainBlock *terrain = TerrainEditor::getTerrainUnderWorldPoint(Point3F(pos));
    	F32 squareSize = terrain->getSquareSize();
     
    	Point2F p;
     
    	GridPoint gp;
     
    	gp.terrainBlock = terrain;
    	// Z-coordinate is not used
    	gp.gridPos = gp.terrainBlock->getGridPos(Point3F(pos));
     
    	GridInfo inf;
    	GridInfo gi;
     
    	TerrainEditor::getGridInfo(gp, gi);
     
    	// If grid is already set to our material, or it is an
    	// empty grid spot, then skip painting.
    	S32 mat = 1;
     
    	inf.mMaterialChanged = true;
     
    	// Painting is really simple now... set the one mat index.
    	inf.mMaterial = mat;
    	TerrainEditor::setGridInfo(inf, true);
     
    	TerrainEditor::scheduleMaterialUpdate();
     
    }

     

    it should work but i cannot run the Method mow - i have done this already after the method:

     

    DefineEngineMethod(TerrainEditor, mow, void, (), ,"")
    {
    	object->mow();
    }

     

    i try to run the following command in TorqueScript:

     

    ETerrainEditor.mow();

     

    and already added the method in the terrainEditor.h:

     

    void mow();

     

    so it seems that the function "mow" couldnt run of course there is NOT an Syntax error because it runs without any errors ... but i dont know fruther :roll:


    Would be nice if you could help - thx!


    Greetings

    Robert

  10. Hi there,


    sorry for my Question ... i try to exec the following function in play mode:


    ETerrainEditor.autoMaterialLayer(-10000, 10000, 0, 90, 100);


    now i execute this function in the console window.

    it doenst work - but if i try in editor mode it works.


    Maybe u can help me with that - Thanks a lot!


    Greetz

    Robert

×
×
  • Create New...