Crystal Space
Welcome, Guest. Please login or register.
August 29, 2014, 03:41:07 pm

Login with username, password and session length
Search:     Advanced search
9009 Posts in 2043 Topics by 8358 Members
Latest Member: Rodgerkline
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Projects
| |-+  Project Discussion
| | |-+  addinsidebox problem
« previous next »
Pages: [1] Print
Author Topic: addinsidebox problem  (Read 9151 times)
mik
Newbie
*
Posts: 36


View Profile Email
« on: October 17, 2008, 04:34:05 pm »

Hi, now i'm working with sectors and i have a problem when i create in a sector a box where draw inside my objects. When i give the two csVector3 of the parameters of addInsideBox of iThingFactoryState sometimes the render is good and other times is like when you are out of range or in a wall but this depends on what coordenates i give. For example, when i give the two points (-2000,-2000,-2000) and (2000,2000,2000) or (-60000,-60000,-60000) and (2000,2000,2000) the visualitation is all right, but if i insert (-3000,-3000,-3000) and (3000,3000,3000) appear problems. Do you have any idea about that? (All the coordinates are big enough for the object that i draw inside)
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: October 17, 2008, 07:06:21 pm »

First I would like to know what version of CS you are using.

Secondly I would like to see a bit more complete source code of the program that is not working.

Greetings,
Logged
mik
Newbie
*
Posts: 36


View Profile Email
« Reply #2 on: October 20, 2008, 10:00:52 am »

We are using the 1.2.1 version, and the example code is the same of the simple2 application but we change the size of the box:

Original code:
// Creating the walls for our room.
   csRef<iMeshWrapper> walls (engine->CreateSectorWallsMesh (room, "walls"));
   csRef<iThingFactoryState> walls_state =
      scfQueryInterface<iThingFactoryState> (walls->GetMeshObject ()->GetFactory());
   walls_state->AddInsideBox (csVector3(-5, 0, -5), csVector3(5, 20, 5));

We are having problems when use, instead of (-5,0,-5),(5,20,5), the points (-6000,-6000,-6000),(6000,6000,6000) for example, but if we use (-2000,-2000,-2000),(2000,2000,2000) or (-2000,-2000,-2000),(60000,60000,60000) there aren't problems.

Our object only need a box of (-600,-800,-1000),(600,836,1000).

Thanks for your constant help.

Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: October 20, 2008, 10:04:34 am »

Can you be more specific about the problems?
Logged
mik
Newbie
*
Posts: 36


View Profile Email
« Reply #4 on: October 20, 2008, 11:30:18 am »

Ok, if i use the points (-2000,-2000,-2000),(2000,2000,2000) in AddInsideBox i have this:



But if i use (-6000,-6000-6000),(6000,6000,6000):



And if i move the camera



I have only changed the size of the box making it bigger.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #5 on: October 20, 2008, 11:42:57 am »

Um I don't understand what I am looking at on those pictures? That doesn't look like a box to me.

Greetings,
Logged
mik
Newbie
*
Posts: 36


View Profile Email
« Reply #6 on: October 20, 2008, 12:02:00 pm »

With "changing box size" we mean the world (box) that contains the oil tank that you see on the images, this oil tank has like size
MIN (-600,-800,-1000), MAX (600,836,1000). So we have problems when we have to define the range of the 3D world, the first image is right, but the second  (only with the range different) is wrong, it appears a black background and when you move the camera it´s look like when you are going out limits of the world, but we don´t understand how its posible because the second case world its bigger than the first...
thank you!!!
Logged
mik
Newbie
*
Posts: 36


View Profile Email
« Reply #7 on: October 20, 2008, 12:05:41 pm »

   
by the way Is there any global method to make all polygons that we render no transparent by default?
thanks!
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #8 on: October 20, 2008, 12:06:15 pm »

   
by the way Is there any global method to make all polygons that we render no transparent by default?
thanks!

Polygons are always non-transparent by default.

Greetings,
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #9 on: October 20, 2008, 12:07:03 pm »

With "changing box size" we mean the world (box) that contains the oil tank that you see on the images, this oil tank has like size
MIN (-600,-800,-1000), MAX (600,836,1000). So we have problems when we have to define the range of the 3D world, the first image is right, but the second  (only with the range different) is wrong, it appears a black background and when you move the camera it´s look like when you are going out limits of the world, but we don´t understand how its posible because the second case world its bigger than the first...
thank you!!!

Ok, even though you say it is only a modified simple I think I need to see the source of the non-working example to make any judgements. You made more modifications then only the InsideBox since you also seem to have added a model.

Greetings,
Logged
mik
Newbie
*
Posts: 36


View Profile Email
« Reply #10 on: October 20, 2008, 01:51:41 pm »

Ok, give me an email and i'll send you the code this evening or tomorrow in the morning, but the problem is only in the sector creation.

Thaks.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #11 on: October 20, 2008, 01:52:53 pm »

jorrit dot tyberghein at gmail dot com
Logged
Pages: [1] Print 
« previous next »
Jump to:  

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 3.123 seconds with 16 queries.