Crystal Space
Welcome, Guest. Please login or register.
April 18, 2014, 07:32:10 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7595 Members
Latest Member: Rejestruj1989
* Home Help Search Login Register
  Show Posts
Pages: 1 2 3 [4]
46  Crystal Space Development / Support / Mesh culling issues on: March 05, 2006, 12:50:43 am
This is a problem I've been trying to figure out for a while (I put it off for months to work more on my project which I'm planning on eventually migrating over to Crystalspace).  I'm trying to create general mesh geometry (such as walls, floors, etc) which are fairly straightforward in CS.  I've used the simple1 tutorial project as a simple testbed, and have run into the same problem over multiple versions of CS (since around Spring 2005).  Basically what I'm trying to do is have the room in simple1 be visible from both the inside and outside (and so I added the AddOutsideBox code and related stuff), but the culling is very strange.  The inside box is always visible even though the outside box is around it, and I've tried creating both boxes in separate meshes, adding different lighting (and turning off lighting), tried the UpdateMove function that Jorrit recommended before, etc, and it still has the same problem.

I've got my modified source along with a win32 binary and a screenshot on my site - I just want to know how to fix this problem haha.

Basic info:
2 machines, both with CS 0.99 from Jan 27 2006
Win32 libs 0.99r018
OS is Windows 2000, compiler is MSVC8 Express
Video card on first machine is an nVidia Geforce4 MX 4000 w/128mb VRAM; second machine (laptop) has an old Trident Cyberblade/XP w/16mb VRAM
Driver on first is version 81.95

Here's a screenshot:


In the screenshot, you can see the outer wallbox, and I placed a white light outside on the right side (you can see the reflection).  Whenever you move around, the inside box continues to remain visible no matter what direction or position you're in.

The source and stuff is here:
http://www.tliquest.net/skyscraper/test

Here's the code section that I modified:
Code:
  // Creating the walls for our room.
  csRef<iMeshWrapper> walls (engine->CreateSectorWallsMesh (room, "walls"));
  csRef<iMeshObject> walls_object = walls->GetMeshObject ();
  csRef<iMeshObjectFactory> walls_factory = walls_object->GetFactory();
  csRef<iThingFactoryState> walls_state =
    scfQueryInterface<iThingFactoryState> (walls_factory);
  walls_state->AddInsideBox (csVector3 (-5, 0, -5), csVector3 (5, 20, 5));
  walls_state->SetPolygonMaterial (CS_POLYRANGE_LAST, tm);
  walls_state->SetPolygonTextureMapping (CS_POLYRANGE_LAST, 3);

  walls_state->AddOutsideBox(csVector3 (-6, -1, -6), csVector3 (6, 21, 6));
  walls_state->SetPolygonMaterial (CS_POLYRANGE_LAST, tm);
  walls_state->SetPolygonTextureMapping (CS_POLYRANGE_LAST, 3);

  // Now we need light to see something.
  csRef<iLight> light;
  iLightList* ll = room->GetLights ();

  light = engine->CreateLight(0, csVector3(-3, 5, 0), 10, csColor(1, 0, 0));
  ll->Add (light);

  light = engine->CreateLight(0, csVector3(3, 5,  0), 10, csColor(0, 0, 1));
  ll->Add (light);

  light = engine->CreateLight(0, csVector3(0, 5, -3), 10, csColor(0, 1, 0));
  ll->Add (light);

  light = engine->CreateLight(0, csVector3(3, 5, -7), 10, csColor(1, 1, 1));
  ll->Add (light);

Thanks
eventhorizon
47  Crystal Space Development / Support / Re: Problems on VC2005 (aka VC8) on: August 20, 2005, 06:45:18 am
That is not a solution to the problem, maybe a solution to the syptom Wink CS_WIN32_CSCONFIG should be defined in your projects settings, please read http://crystalspace3d.org/docs/online/manual/cs_4.21.3.php#4.21.3

Sorry for posting so late (I got CS working after messing around with that .h file), but the CS_WIN32_CSCONFIG was defined in my project settings.  Somehow it just wasn't working with that file, so I fixed it myself Wink I'll do a new win32 build and see if the problem is still there.

-eventhorizon
48  Crystal Space Development / Support / Re: Problems on VC2005 (aka VC8) on: July 14, 2005, 05:37:19 am
The problem might just be the project I'm trying to build.  I just extracted the Simple1 demo from the source tree, and made it into an external VC8 project - it builds fine.

-eventhorizon
49  Crystal Space Development / General Crystal Space Discussion / Re: Migrating from Truevision3D to Crystal Space on: July 13, 2005, 08:29:54 am
For the first question take a look at the simple1 tutorial. That code looks like this:

Code:
  // Creating the walls for our room.
  csRef<iMeshWrapper> walls (engine->CreateSectorWallsMesh (room, "walls"));
  csRef<iThingState> ws =
    SCF_QUERY_INTERFACE (walls->GetMeshObject (), iThingState);
  csRef<iThingFactoryState> walls_state = ws->GetFactory ();
  walls_state->AddInsideBox (csVector3 (-5, 0, -5), csVector3 (5, 20, 5));
  walls_state->SetPolygonMaterial (CS_POLYRANGE_LAST, tm);
  walls_state->SetPolygonTextureMapping (CS_POLYRANGE_LAST, 3);

This will create a box that you can see from the inside. However iThingFactoryState has other functions where you can create individual polygons to make any shape you want. Check out the API ref of iThingFactoryState. Let me know if you still have problems.

For the second question there are various flags you can set on the mesh wrapper like this:

Code:
iMeshWrapper* mesh = ...;
mesh->GetFlags ().Set (CS_ENTITY_INVISIBLEMESH); // To make a mesh invisible.

Greetings,

Currently Skyscraper's code has come mostly from the Simple1 tutorial, and I have made wall/floor polygon code; I'll have to see how the CVS version works, because the stable version of CS was behaving really strange (I created an insidebox and outside box, but they had visibility issues).
Also thanks for that info on the mesh flags - when I was going through the CS source before, I was wondering if that stuff was done by setting flags.  Also (this one's not really in any tutorial) how do you easily create a skybox/moving sky? (unless there's a new tutorial in the CVS version, since I just built it).

-eventhorizon
50  Crystal Space Development / General Crystal Space Discussion / Migrating from Truevision3D to Crystal Space on: July 13, 2005, 08:00:48 am
My project (Skyscraper) was originally written in Visual Basic 6 along with the TrueVision3D graphics engine www.truevision3d.com, and I'm in the process of rewriting it in C++/Crystal Space.  Since Truevision is a very high-level 3d object-oriented engine, I'm trying to figure out what the CS equivalents would be (I've got some very simple things working, but I'm having major issues).  In the Skyscraper app, a 138-story building is generated in realtime (mostly at startup) using Truevision calls in VB code, and the only 3D models are minor things like windows.  I'm wondering if CEL provides similar functionality, since I've read some stuff about it, but don't fully understand what it does.

Here's my main thread for my project: http://community.crystalspace3d.org/forum/index.php/topic,155.0.html

Here I'll explain Truevision stuff so that you'll understand what I'm talking about, because if I can get CS to do the same stuff, development will start flying (right now it's crawling haha).

Here's the current C++/CS code for Skyscraper in CVS:
http://www.tliquest.net/cgi-bin/viewcvs.cgi/skyscraper/

And here's the last build of the abandoned VB/TrueVision rewrite (this is 1.1 alpha code - the 1.0 stable code is very messy and 1.1 is much much cleaner):
http://www.tliquest.net/cgi-bin/viewcvs.cgi/skyscraper/?only_with_tag=build_177

I would recommend looking at this VB file (this is the floor class):
http://www.tliquest.net/cgi-bin/viewcvs.cgi/skyscraper/src/Attic/Floor.cls?rev=1.1.1.6&only_with_tag=build_177&view=markup

So for example, this is how you would create a mesh and add some walls in it, using Truevision (this is just the mesh code, and not the rendering, etc code):

Code:
Dim Level As TVMesh
Set Level = Scene.CreateMeshBuilder("Level")
Level.AddWall GetTex("stone"), x1, z1, x2, z2, height, altitude, tw, th
Level.AddFloor GetTex("stone"), x1, z1, x2, z2, altitude, tw, th

where x1, z1, etc are the coordinates; altitude is the base Y coordinate, height is the top Y coordinate, tw and th are the horizontal and vertical texture resolution parameters (the CS equivalent of that seems to be SetPolygonTextureMapping, where the last value would be both the tw and th combined).

I've tried making CS versions of those, but with bad results.
I also am trying to figure out what the equivalent of this would be:

Code:
Level.Enable False

That command entirely disables a mesh from rendering, collision detection, etc.

So those are just some examples.  I code like mad in VB with Truevision, but I'm still building up my C++ skills (took classes on it before, but never could fully jump off of VB).  I mainly want my stuff to be fully cross-platform, and to not be limited by proprietary MS crap haha.

-eventhorizon
51  Crystal Space Development / Support / Problems on VC2005 (aka VC8) on: July 13, 2005, 07:27:16 am
I just recently tried building Crystal Space on Visual C++ 2005 Express Beta2/VC8 (the free download, which I have been using to develop my project with before, since I need better command completion and stuff), and it built fine (so no problems there).  I used to have 0.98 R004 built with VC6, and my app (Skyscraper 1.1) being built in VC8, which worked perfectly, but decided to get the CVS version of CS and build it in VC8 (7/12/2005 snapshot).  I'm having a preprocessor issue that is very strange, since I've defined all of the required stuff in the new manual for external VC7 projects, but it just doesn't work.  I'm probably going to try messing around with the CS .h files to see what the problem is.  I'd use VC71 if I could, but I'm broke haha.

This is what I'm getting:

c:\cs\include\csplatform.h(26) : fatal error C1083: Cannot open include file: 'csconfig.h': No such file or directory

PP definitions (debug build): WIN32;_DEBUG;_CONSOLE;CS_WIN32_CSCONFIG;__CRYSTAL_SPACE__;CS_DEBUG

portion of csplatform.h that's part of the problem:
// Include csconfig.h which contains the volatile configuration macros
#if defined (CS_WIN32_CSCONFIG)
#  include <csutil/win32/csconfig.h>
#else
#  include <csconfig.h>
#endif

So I'm guessing that the CS_WIN32_CSCONFIG definition is somehow not defined, even though it's explicitly defined in the project config (I have no clue why).
More info: I'm running on Win2k, using VC8 Express Beta2, and am using the Feburary 2003 Platform SDK (my laptop has a newer one - I should see if that might be the problem).  I would much rather code in Linux but I need to be on Winsux on my laptop most of the time (this desktop machine runs in Linux most of the time though; Debian Etch/Testing).

Any thoughts on this?

-eventhorizon
52  Crystal Space Projects / WIP Projects / Re: Skyscraper Project on: July 12, 2005, 02:21:16 am
If anyone wants to help out, just email me (I'm currently having issues with getting Crystal Space to work properly haha; mainly because I'm migrating over from TrueVision3D).
email: ryan@tliquest.net

Here's my 2.0 Prospectus from the website, which outlines what I've planned for the rewrite. Also wxWidgets has been dropped and I'll eventually use QT4 for external stuff:

------------------
Skyscraper Prospectus
Ryan Thoryk, 5/29/05

The Skyscraper Project originally began with the simplistic design of a 138-story skyscraper called the Triton Center that I completed on May 4, 2002, using the MyHouse for Windows 6.5 architectural designer application. Later that year I started tinkering with the TrueVision3D graphics engine through Visual Basic 6, and made a small building with a simple but working elevator. This became Skyscraper versions 0.1 and 0.2. I then continued to enhance it, and decided to try to simulate the entire Triton Center. I eventually finished the entire external structure of the building, and still had only 1 elevator. A single shaft bank was made, which housed 10 elevators (5 on each side), and then I eventually duplicated it to increase the number of elevators to 40, divided into 4 shaft banks. All the other parts of the program were made and enhanced, and I started to hit limitations that were not only in my program design, but also in the Visual Basic language itself. So after version 0.96 I forked the code and started redesigning the core of the program, but it became too unstable and needed a great deal of work (this was originally going to be version 0.97); so I took 0.96, fixed it up, and released it as 1.0. I renamed 0.97 to 1.1 alpha, which is the current development project. I rewrote somewhere around 25% of Skyscraper, and then after long periods of other stuff going on in my life, I decided to stop the VB rewrite and start porting the entire program over to C++ (I considered the C# and Java languages before choosing C++). The new C++ version is now at the beginning stages, and I am mainly brushing up on my C++ knowledge before continuing development.

Scalability and expandability factors were considered as early as summer 2003, but were postponed until later (and they’re now part of the design plans of the C++ version). In 2003 many people were complaining about how Skyscraper only simulated a single building, and couldn’t allow people to design others. I explained to them that Skyscraper was still in an early stage, and that the ability to load other buildings as data files is nowhere near easy. Many people also were practically drooling over the thought of having multiplayer deathmatch support in the program, but I explained that I needed to finish more of the main simulation before I start working on multiplayer features. For a while I also had the idea of creating a building designer applet inside the program, which would allow the user to create their own building and save it into a data file, which could then be loaded by the simulation. The original ideas called for a simplistic CAD-like interface that would allow the person to visually create what I had manually coded. I expanded on that idea recently by planning a single player portion of the simulation engine, which would allow the user to create the building during the simulation, and would make it operate very similar to both Sim Tower and Yoot Tower (sequel). All of these ideas will require a massive amount of coding, and so a team of developers would greatly help out.


Skyscraper version 2.0 (of which 1.1 alpha is part of) calls for a highly realistic, real-time, 3D first person simulation of buildings loaded via data files. It also calls for a building designer application that will allow users to create their own buildings and simulate them, single-player elements similar to Sim Tower and Yoot Tower, and multi-player elements such as deathmatch or capture-the-flag scenarios. Everything possible will be simulated, including all the regular parts of buildings (rooms, elevators, stairs, etc), but also crawlspaces, air ducts, elevator shafts, elevator escape hatches, breakable windows, pipe shafts, and lots more. The Visual Basic version of 1.1 alpha currently has an abstraction layer for the 3rd party 3D graphics engine, so that the current one (TrueVision3D) can be replaced by another (CrystalSpace 3D) with very little effort. The entire building simulation system will be contained in a series of DLL files, and is currently called the Scalable Building Simulator, or SBS. The program’s application file (EXE file) will only be the graphical front-end for SBS; everything else will be either handled internally by SBS or by other DLL libraries that would use the SBS API. This way, the program becomes an actual backend simulation engine that can be linked with other applications. It will use the wxWidgets library as the GUI toolkit, thus eventually allowing it to be seamlessly multiplatform (for Windows, MacOS, Linux, BSD, Solaris, IRIX, etc).
------------------

-eventhorizon

53  Crystal Space Projects / WIP Projects / Skyscraper Project on: June 29, 2005, 12:07:16 am
I just recently started rewriting Skyscraper to C++ with CrystalSpace, and am also trying to use the wxWidgets library in it (but the winmain functions of each conflict, including the window generation).  Skyscraper 1.0 was written in VB6 and used the TrueVision3D engine, and a VB rewrite was originally started last year, but was abandoned in favor of this C++ version (1.0 had very sloppy monolithic code, but 1.1 is supposed to be very clean and highly abstracted, for the purpose of separating the simulation engine into a backend library).  If you don't know what the program is, it's a building simulator, and will eventually be fully featured, with even capabilities to load custom buildings from data files.  FPS single and multiplayer features are planned, and lots more.

Mainly I'm just learning CrystalSpace, and also I'm learning more of the areas of C++ that I wasn't comfortable with before.

http://www.tliquest.net/skyscraper
To get a good idea of where the project is headed, read the 2.0 Prospectus on the site Smiley

Local CVS repository (Sourceforge CVS is also used):
http://www.tliquest.net/cgi-bin/viewcvs.cgi

Screenshot of version 1.0 (more on the site - and the FPS count is low on there because it's running on my laptop's crappy video chipset haha):


-eventhorizon
Pages: 1 2 3 [4]
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 8.358 seconds with 16 queries.