Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / My imported object is strange

Author
Message
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 9th Apr 2007 12:36
Ok i hope that you understand my problem!

I am starting with my first project here the steps:

1)Using DeleD tool i make a cylinder that is empty inside! In other words you will can fly inside this giant cylinder! I use many polygons for make it. In the image you can see that one side of cylinder is closed!!! but other side (tht you can\'t see from image) is open.

You also notice that the cylinder is very big (you can compare it with standard reference 3d axys map of DeleD).

2)Now i apply 2 dofferent textures. First texture for the cylinder and second texture for the \"wall\" that close the side. I using standard DeleD textures

3) Ok i convert and export my cylinder in DirectX X object

4) This is my super simple DBPro code:

load object \"d:\\mypath\\big_cylinder.x\",1
make camera 1
set camera range 1,0,10000 rem very far view \'cause my cylinder is very big
do
control camera using arrowkeys 1,40,5

sync
loop

Ok i can see my big cylinder and i can fly for see it in different angles BUT!!!.... i notice that the surface is like transparent but only in determinate poisition of camera!!! WHY????
Lost in Thought
22
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 9th Apr 2007 13:18
Why not post a screen shot of it in DBP?

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 9th Apr 2007 20:02
yes this is the screen from my demo!
You can see that the inside of cylinder is visible!
xhammettx
19
Years of Service
User Offline
Joined: 8th Apr 2007
Location:
Posted: 9th Apr 2007 20:18
i think someone on this forum needs to post a: "how to load and interact with levels and objects" tutorial on this website. That would save so much frustration.
Cash Curtis II
21
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 9th Apr 2007 20:30
You need to flip your normals. Then instead of the inside being visible, the outside should be.


Come see the WIP!
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 9th Apr 2007 21:54
Okok in first i am happy that there is a solution!
But please, can you tell me exactly what i must do?

What is "my normals"? Please tell me step by step what i must do!!
and thx very much!
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 9th Apr 2007 22:04
use the set object command to disable culling

set object objnum,1,1,0,1,1,1

if it doesn't work change the 0 into 1
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 9th Apr 2007 22:15
mmm ok i try to using "set object objnumb,1,1,0,1,1,1
and the effect is different but ever wrong! (see the picture).Seems that now the texture works better but don't reach the good and complete cover of the cylinder!

if i use objnumb,1,1,1,1,1,1 the situation is like if i dont use this command!!

maybe my cylinder is too thin?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Apr 2007 00:03
For an object, normals are vectors that are applied to vertices and point outwards. The normals are used as a point of reflections for lighting.

This isn't the problem that you are having, so you can disregard it.

Now for the problem you are having.

A poly has two sides. As one side of the poly is usually hidden on the inside of the object, drawing it will only slow down rendering overall, so DirectX allows you to specify that only the front-side of the poly is drawn - this is the default setting for objects in DBPro.

Basically, as it takes a poly and places it in front of the camera, it checks to see if the vertices making up that poly are arranged in a clockwise or anticlockwise order. If clockwise, it simply skips the rendering of that poly.

This system can be disabled so that all poly's are always rendered by disabling the culling on the object. Scorpyo has shown one way, but you might find the command SET OBJECT CULL a little easier to use.

If you still have problems with the culling, then maybe this isn't your problem - post the model to the forum so we can check it out.

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 10th Apr 2007 01:11
In first i want thx to all you for help!

Then.. test "set object cull" command too but problem persists!

ok now i post the model (in the X format) so you can check it!(i must compress the file if not uploader applet dont work)

If you want i can add the DeleD model too!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Apr 2007 01:36 Edited at: 10th Apr 2007 01:39
Well, I don't have any problem with that model. I had to create 2 jpg's for the textures, but apart from that there were no problems.

Attached, working project file.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Apr 2007 01:37 Edited at: 10th Apr 2007 01:37
and here's a screenshot:



Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 10th Apr 2007 01:37
it's without texture..
anyway, all is normal here apparently - see pic

it seems that your texture has strips of black set to transparent

try set object objnum,1,0,0
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 10th Apr 2007 01:51
Ok guys, the Iam demo works fine in my pc too! but is without textures!
Scorpyo i try the "set object 1,1,0,0" but the problem persist!!
Maybe is true the fact about my textures; I use the Deled default textures and maybe these textures are wrong in someway.
But your picture is damn RIGHT! so, can you provide me your project?
xhammettx
19
Years of Service
User Offline
Joined: 8th Apr 2007
Location:
Posted: 10th Apr 2007 02:24
can someone put up a tutorial on how to load and interact with a world?
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 10th Apr 2007 15:27
Ok if you see the picture you see that now its all right. Here my solution:

The folder provided me from IanM was a floder that contains cylinder.x, code and textures.
when i run demo the cylinder is without textures so i go to the folder and i notice that the 2 textures was both 1x1 pixels. Then i modify these two 1x1 textures both in 256x256.
Now its all right!
But 2 answer:
1) when i export X object in deled i make a new X file.Ok, but the textures must be in the same folder of is located x files? OR x file have inside his code the textures?
In other words when i make a texturized object and i export this in X format i obtain:
A) only a X file?
or
B) a X file + textures images?

if in my code i use:
load object "c:\my_folder\cylinder.x",1
in the folder my_folder must be only cylinder.x or cylinder.x + texture images?

THX!
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 10th Apr 2007 17:36 Edited at: 10th Apr 2007 17:38
Also, in your posted code you put SET CAMERA RANGE 1,0,10000

You should NEVER put 0 as second parameter (the near value) as that will cause all sorts of z-fighting and texture issues. It is a very common mistake.

Try 1 and you may find your problem is solved.

Also do not create a new camera if you dont need to as you effectively double the amount of rendering (camera 1 covers camera 0 as default).

99% of games do not need a created camera as camera 0 is created automatically for you, so just put

SET CAMERA RANGE 1,10000

Boo!
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 10th Apr 2007 17:52
yeah spooky i was in many errors:

1) I try to load an object X from a folder in which there aren't the object textures!

2) I was using SET CAMERA RANGE near parameter set to 0 causing error that you report!

3) I was using MAKE CAMERA command when i don't need it!!

I want to thank you all for big help!! THX GUYS!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Apr 2007 21:08
The good thing about this X file is that it's in text format ... if you want to place the textures into another folder, just edit the X file with a text editor and change the texture filenames to include the amended path, and make sure you use 2 backslashes instead of 1 as separators.

e.g If you move wall06.JPG into a Textures sub-folder, the amended name will be "Textures\\wall06.JPG"

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 10th Apr 2007 22:43
wow IanM this is another good trick!! good to know now!!
Master Xilo
19
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 12th Apr 2007 17:56
scale object objnum,-100,-100,-100=
Quote: "...to flip your normals. Then... "

Login to post a reply

Server time is: 2026-06-11 10:18:42
Your offset time is: 2026-06-11 10:18:42