loading 3ds objects and display them

Blitz3D Forums/Blitz3D Programming/loading 3ds objects and display them

benoit(Posted 2003) [#1]
Hello folks,

i'm new to 3d programming and i my question will may be sound too simple. my designer has designed 3ds objects and although they load fine in my program (i dont get error messages), i can't display them (no error, just nothing appear on the screen. when i try my program with a 3ds object from blitz examples, they display fine. may be there is an option in 3ds i dont know... anyway, i would be very gratefull if i could send the object to any of you guys that would be kind enough to test. in advance, many thanks...

my email if you wish i send the 3ds object: benoit.varasse@...


Koriolis(Posted 2003) [#2]
First of all, show us the code you use to display the object.
I'm sure we don't need the .3ds to see the problem.
Do they display correctly if you use the little media loader that ships with b3D (simply load a b3d in the IDE: open > select file type for 3ds/.x > select your file)?


benoit(Posted 2003) [#3]
i tried to open the file but i think i dont have the loader cause i use so far the demo version of b3d. would you like to try to load the file for me? here is the code i use:

Graphics3D 640,480
SetBuffer BackBuffer()
WireFrame True
camera=CreateCamera()
PositionEntity camera,0,0,-100
cam_xr#=0:cam_yr#=0:cam_zr#=0:cam_z#=-100
light=CreateLight()
RotateEntity light,90,0,0


table=LoadMesh("table3.3ds")




PositionEntity table,0,0,0

;PositionEntity cube,0,0,0

While Not KeyHit(1)

If KeyDown(203)
cam_yr=cam_yr-2
Else If KeyDown(205)
cam_yr=cam_yr+2
EndIf

If KeyDown(200)
cam_xr=cam_xr+2
;If cam_xr>90 cam_xr=90
Else If KeyDown(208)
cam_xr=cam_xr-2
;If cam_xr<5 cam_xr=5
EndIf

If KeyDown(26)
cam_zr=cam_zr+2
Else If KeyDown(27)
cam_zr=cam_zr-2
EndIf

If KeyDown(30)
cam_z=cam_z+1:If cam_z>-10 cam_z=-10
Else If KeyDown(44)
cam_z=cam_z-1:If cam_z<-180 cam_z=-180
EndIf

PositionEntity camera,0,-10,-100
RotateEntity table,cam_xr,cam_yr,cam_zr
MoveEntity camera,0,0,cam_z

UpdateWorld
RenderWorld
Flip
Wend


merci, Benoit


jfk EO-11110(Posted 2003) [#4]
And with a CreateCube() it works?

you might try EntityFX mesh,16 to disable backface culling . just for the case that your noemals are flipped.
But know that the 3DS Foramt is somewhat undefined, and 3D Studio can save and load a lot in 3DS which is not part of the Standard .3DS Description. As for Animations Blitz as many other Apps supports only Scale/Move/Rotate.


Koriolis(Posted 2003) [#5]
Try that
Graphics3D 640,480 
SetBuffer BackBuffer() 
cam=CreateCamera() 
PositionEntity(cam,0,0,-5)
light=CreateLight() 
RotateEntity light,90,0,0 


table=LoadMesh("table3.3ds") 
;table=CreateCube()

;FitMesh(table,-1,-1,-1,2,2,2, True) ; Uncomment this and see if it helps)
									; (in the case it's just a scaling problem)


While Not KeyHit(1) 

If KeyDown(203) Then 
	TurnEntity(table,0,-2,0)
Else If KeyDown(205) Then 
	TurnEntity(table,0,2,0)
Else If KeyDown(200) Then
	TurnEntity(table,2,0,0)
Else If KeyDown(208) Then
	TurnEntity(table,-2,0,0)
Else If KeyDown(26) Then
	TurnEntity(table,0,0,2)
Else If KeyDown(27) Then
	TurnEntity(table,0,0,-2)
Else If KeyDown(44) Then 
	TranslateEntity(cam,0,0,-1)
Else If KeyDown(30) Then 
	TranslateEntity(cam,0,0,1)
EndIf

UpdateWorld 
RenderWorld 
Flip 
Wend
End

Uncomment the line with FitMesh and see if it helps. If you still see nothing, then it's time to send me the .3DS so that I can see what's wrong :)


benoit(Posted 2003) [#6]
the fitmesh worked! many thanks folks...


ChrML(Posted 2003) [#7]
It should've worked without fitmesh too, though...


Koriolis(Posted 2003) [#8]
No. The fact it works with FitMesh shows it was a scaling problem. Probably the mesh was way too small (or way too big).
Next time Benoit, you can rescale the mesh in 3ds Max before exporting it.