Crystal Space
Welcome, Guest. Please login or register.
October 21, 2014, 05:00:10 am

Login with username, password and session length
Search:     Advanced search
9010 Posts in 2044 Topics by 8766 Members
Latest Member: Msturnocarl03
* Home Help Search Login Register
  Show Posts
Pages: [1] 2 3 ... 7
1  Crystal Space Development / General Crystal Space Discussion / How does CS embedding into WX work? on: September 24, 2006, 06:54:17 am
It's not quite CS related, but still.
I want to embed Irrlicht renderer into wxGTK, but I have no clue as where to start.
I know CS runs perfectly inside wxGTK, so can anyone tell me where to search for the clues?
Something has been said about X Window descriptor which differs from Windows Window descriptor (Irrlicht runs only inside wxMSW at the moment).
So any ideas?
Thanks.
2  Crystal Space Development / General Crystal Space Discussion / How to binary-read a file on VFS? on: July 04, 2006, 12:40:15 pm
i need to rewrite this in VFS:
Code:
    FILE *f;
    f = fopen (filename, "rb");
    if (f == NULL)
        return false;
    fread (&version, sizeof (TBXVersion), 1, f);
so i tried this:
Code:
    csRef<iVFS> vfs;
    vfs = csQueryRegistry<iVFS> (obj_reg);
    csRef<iFile> f = vfs->Open (filename, VFS_FILE_READ);
    f->Read (version, sizeof (TBXVersion));
but i get errors:
Code:
tbx.cpp: In member function `bool TBXFile::Open(char*)':
tbx.cpp:14: error: no matching function for call to `iFile::Read(TBXVersion&,
   unsigned int)'
/usr/local/include/crystalspace/iutil/vfs.h:134: error: candidates are: virtual
   size_t iFile::Read(char*, unsigned int)
make: *** [obj/tbx.o] Error 1
so how to read structures?

thanks.
3  Crystal Space Project Development / Bug Reports / Re: Current version (CVS) compiling errors on: July 03, 2006, 05:06:21 pm
i'm trying to compile 03-Jul-2006 CS snapshot.
here's the compile log: http://www.everfall.com/paste/id.php?c7d6hh2mvuhj
thanks.
4  Crystal Space Development / General Crystal Space Discussion / Re: How to make normals point not from vertices, but from planes? on: July 03, 2006, 04:50:39 am
you're correct but i know how to make it in Blender, i just see how ugly it's done in CS Smiley
5  Crystal Space Development / General Crystal Space Discussion / Re: How to make normals point not from vertices, but from planes? on: June 18, 2006, 02:25:29 am
I remember OpenGL can do this with a single object, no need to split it. I see, CS doesn't use this OpenGL "feature" :/
6  Crystal Space Development / General Crystal Space Discussion / Re: How to make normals point not from vertices, but from planes? on: June 17, 2006, 04:49:31 pm
I have a videocard without shaders... and splitting will slow down performance.

Thanks.
7  Crystal Space Development / General Crystal Space Discussion / How to make normals point not from vertices, but from planes? on: June 17, 2006, 01:55:16 pm
Normals from vertices make objects smooth. I want to make it "ugly".
To say in Blender terms, I want an objects to become "Solid", not "Smooth" as it is by default.

Thanks.
8  Crystal Space Development / General Crystal Space Discussion / Re: How to make a shade? on: May 22, 2006, 07:46:44 am
I can't remember if i already told it, but now it works...
9  Crystal Space Development / General Crystal Space Discussion / Re: How to color a mesh (wrapper)? on: May 11, 2006, 12:51:27 pm
Code:
        X3DDocument x3d_doc ("/this/models/workspace.x3d", obj_reg);

        vector<X3DTransform> transforms = x3d_doc.GetTransforms ();
        const int NUM_OF_OBJS = transforms.size ();

        cout << "num of trans = " << NUM_OF_OBJS << endl;

        csRefArray <iMeshFactoryWrapper> x3d_objs_fact (NUM_OF_OBJS);
        csRefArray <iGeneralFactoryState> x3d_objs_fact_states (NUM_OF_OBJS);

        for (int i = 0; i < NUM_OF_OBJS; i++) {
                csRef<iMeshFactoryWrapper> fw_tmp;
                csRef<iGeneralFactoryState> fws_tmp;

                fw_tmp = engine->CreateMeshFactory ("crystalspace.mesh.object.genmesh",
                                "one_of_obj_facts");
                x3d_objs_fact[i] = fw_tmp;
                fws_tmp = scfQueryInterface<iGeneralFactoryState> (
                                x3d_objs_fact[i]->GetMeshObjectFactory ());
                x3d_objs_fact_states[i] = fws_tmp;

                x3d_objs_fact_states[i]->SetLighting (false);
                x3d_objs_fact_states[i]->SetManualColors (false);

                // Add vetices and triangles

                vector<csVector3> vertices = transforms[i].GetVertices ();
                vector<csTriangle> tris = transforms[i].GetTris ();

                for (int j = 0; j < vertices.size (); j++) {
                        x3d_objs_fact_states[i]->AddVertex (
                                        csVector3 (vertices[j].x, vertices[j].y, vertices[j].z),
                                        csVector2 (0, 1), csVector3 (1, 1, 1), csColor4 (1, 1, 1, 1)
                                        );
                }
                for (int j = 0; j < tris.size (); j++) {
                        x3d_objs_fact_states[i]->AddTriangle (
                                        csTriangle (tris[j].a, tris[j].b, tris[j].c)
                                        );
                }
                x3d_objs_fact_states[i]->CalculateNormals ();

                csVector3 translation = transforms[i].GetTranslation ();

                csRef<iMeshWrapper> obj = engine->CreateMeshWrapper (x3d_objs_fact[i],
                                "obj", room, csVector3 (0 + translation.x, 20 + translation.y,
                                        0 + translation.z));
                csRef<iGeneralMeshState> obj_state = scfQueryInterface<iGeneralMeshState> (                                obj->GetMeshObject ());

                obj_state->SetMaterialWrapper (null_mw);
                csRandomGen rnd;
                cout << "rnd.Get = " << rnd.Get () << endl;
                obj_state->SetColor (csColor (rnd.Get (), rnd.Get (), rnd.Get ()));
                cout << "IsManualColors = " << obj_state->IsManualColors () << endl;
                cout << "IsLighting = " << obj_state->IsLighting () << endl;
        }
10  Crystal Space Development / General Crystal Space Discussion / Re: How to color a mesh (wrapper)? on: May 11, 2006, 11:11:25 am
I SetLighting (false) and SetManualColors (false), but all is the same. I even tried this functions upon MeshFactoryState (previously tried on MeshState), still no success.
What to do?

Thanks.
11  Crystal Space Development / General Crystal Space Discussion / Re: How to make a shade? on: May 11, 2006, 11:09:51 am
Doesn't work. All is the same.
12  Crystal Space Development / General Crystal Space Discussion / How to make a shade? on: May 11, 2006, 05:44:19 am
As you probably know, I get only a single colored model.
Although, you'll tell me how to color it, it won't be shaded. I mean it won't look like 3D as things like GenerateSphere look like.
So the question is how to make a genmesh look like 3D (make it shaded)?
A mesh is made of AddVertex and AddTriangle.

Thanks.
13  Crystal Space Development / General Crystal Space Discussion / How to color a mesh (wrapper)? on: May 11, 2006, 05:42:47 am
I'm doing this:
Code:
obj_state->SetMaterialWrapper (null_mw);
obj_state->SetManualColors (true);
obj_state->SetColor (csColor (random () % 256, random () % 256, random () % 256));
null_mw is 1x1 png of white color. I texture map it every polygon, then I try to color it, but it doesn't work. I tried to do without setting material wrapper, but app segfaults then. So how to color a mesh (wrapper)?

All I get when loading an X3D model is this: http://kornerr.users.kemcity.ru/pictures/single_colored_X3D_model_8bpp.png

Thanks.
14  Crystal Space Development / General Crystal Space Discussion / Re: How to make a 2D game? on: May 01, 2006, 03:29:08 pm
I need to make a 2D game constituted of a chess board and draughts on it.
15  Crystal Space Development / General Crystal Space Discussion / Re: How to make a 2D game? on: May 01, 2006, 01:18:01 pm
How will I see anything without camera?
Pages: [1] 2 3 ... 7
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.717 seconds with 16 queries.