Author Topic: object setTexture  (Read 2150 times)

Offline yxbnnl

  • byte
  • *
  • Posts: 19
    • View Profile
object setTexture
« on: March 04, 2009, 08:40:35 am »
Hi:
   when I import the *.3ds files, how to find out  the relationship between Texture and Object3D .In my application,I want to use Object3D.setTexture() to build the relationship between Object3D and Texture that defined in 3ds files. 
code:
      Loading Texture...E:/个人资料/java3D资料/brick_3ds/bkmap.jpg
Loading Texture...E:/个人资料/java3D资料/mercedesSLK2004/cam_arka.bmp
[ Wed Mar 04 15:08:28 CST 2009 ] - ERROR: File 'E:/个人资料/java3D资料/mercedesSLK2004/cam_arka.bmp' not found - replacement texture used instead!
Loading file E:/个人资料/java3D资料/mercedesSLK2004/mercedes_slk.3DS
Expanding buffers...1000000 bytes
Expanding buffers...1500000 bytes
Expanding buffers...2000000 bytes
Expanding buffers...2500000 bytes
Expanding buffers...3000000 bytes
Expanding buffers...3500000 bytes
Expanding buffers...4000000 bytes
Expanding buffers...4500000 bytes
Expanding buffers...5000000 bytes
Expanding buffers...5500000 bytes
Expanding buffers...6000000 bytes
Expanding buffers...6500000 bytes
Expanding buffers...7000000 bytes
Expanding buffers...7500000 bytes
Expanding buffers...8000000 bytes
Expanding buffers...8500000 bytes
Expanding buffers...9000000 bytes
Expanding buffers...9500000 bytes
Expanding buffers...10000000 bytes
Expanding buffers...10500000 bytes
Expanding buffers...11000000 bytes
Expanding buffers...11500000 bytes
Expanding buffers...12000000 bytes
Expanding buffers...12500000 bytes
Expanding buffers...13000000 bytes
Expanding buffers...13500000 bytes
File E:/个人资料/java3D资料/mercedesSLK2004/mercedes_slk.3DS loaded...13240241 bytes
Processing new material 02 - Default!
Processing new material siyah2!
Processing new material 05 - Default!
Processing new material siyah!
Processing new material cam_on!
Processing new material zgra!
Texture named ZGARA.JPG added to TextureManager!
Processing new material Material #40!
Processing new material Material #65633!
Texture named PLAKA.BMP added to TextureManager!
Processing new material 09 - Default!
Processing new material 16 - Default!
Texture named D1.BMP added to TextureManager!
Processing new material 19 - Default!
Processing new material 17 - Default!
Texture named KONSOL.BMP added to TextureManager!
Processing new material 20 - Default!
Texture named DASH.BMP added to TextureManager!
Processing new material 21 - Default!
Processing new material 22 - Default!
Processing new material ayna!
Processing new material gri!
Processing new material 24 - Default!
Texture named VITES.JPG added to TextureManager!
Processing new material Material #65922!
Texture named S2.BMP added to TextureManager!
Processing new material Material #65910!
Processing new material cam_arka!
Processing new material cam!
Processing new material 08 - Default!
Texture named STOP3.BMP added to TextureManager!
Processing new material 11 - Default!
Texture named DOOR2.BMP added to TextureManager!
Processing new material Default!
Processing new material 10 - Default!
Texture named DOOR.BMP added to TextureManager!
Processing new material Material #65958!
Processing new material 19 - Default1!
Processing new material Material #65975!
Processing new material 22 - Default1!
Texture named DISK.BMP added to TextureManager!
Processing new material 05 - Default1!
Processing new material gri1!
Processing new material 23 - Default!
Texture named DISK2.BMP added to TextureManager!
Processing object from 3DS-file: kaput
Object 'kaput_jPCT0' created using 14832 polygons and 7869 vertices.
Processing object from 3DS-file: tampon
Object 'tampon_jPCT1' created using 25904 polygons and 13611 vertices.
Processing object from 3DS-file: camurluk
Object 'camurluk_jPCT2' created using 15728 polygons and 8237 vertices.
Processing object from 3DS-file: camurluk_a
Object 'camurluk_a_jPCT3' created using 11888 polygons and 6206 vertices.
Processing object from 3DS-file: tampon_ark
Object 'tampon_ark_jPCT4' created using 12912 polygons and 6802 vertices.
Processing object from 3DS-file: spoiler
Object 'spoiler_jPCT5' created using 9216 polygons and 4876 vertices.
Processing object from 3DS-file: dav
Object 'dav_jPCT6' created using 6160 polygons and 3280 vertices.
Processing object from 3DS-file: cam_on
Object 'cam_on_jPCT7' created using 2112 polygons and 1113 vertices.
Processing object from 3DS-file: zgara
Object 'zgara_jPCT8' created using 320 polygons and 215 vertices.
Processing object from 3DS-file: sis
Object 'sis_jPCT9' created using 43552 polygons and 23061 vertices.
Processing object from 3DS-file: Plaka
Object 'Plaka_jPCT10' created using 2624 polygons and 1341 vertices.
Processing object from 3DS-file: Plane04
Object 'Plane04_jPCT11' created using 102 polygons and 78 vertices.
Processing object from 3DS-file: Plane07
Object 'Plane07_jPCT12' created using 4832 polygons and 2539 vertices.
Processing object from 3DS-file: Object04
Object 'Object04_jPCT13' created using 12416 polygons and 6548 vertices.
Processing object from 3DS-file: Box01
Object 'Box01_jPCT14' created using 1920 polygons and 982 vertices.
Processing object from 3DS-file: Box02
Object 'Box02_jPCT15' created using 1168 polygons and 617 vertices.
Processing object from 3DS-file: Object03
Object 'Object03_jPCT16' created using 100 polygons and 66 vertices.
Processing object from 3DS-file: Object08
Object 'Object08_jPCT17' created using 3552 polygons and 1975 vertices.
Processing object from 3DS-file: Object05
Object 'Object05_jPCT18' created using 3824 polygons and 2091 vertices.
Processing object from 3DS-file: torp
Object 'torp_jPCT19' created using 26200 polygons and 14561 vertices.
Processing object from 3DS-file: konsol
Object 'konsol_jPCT20' created using 5312 polygons and 2981 vertices.
Processing object from 3DS-file: dash
Object 'dash_jPCT21' created using 2016 polygons and 1116 vertices.
Processing object from 3DS-file: Plane02
Object 'Plane02_jPCT22' created using 4 polygons and 6 vertices.
Processing object from 3DS-file: koltuk1
Object 'koltuk1_jPCT23' created using 17520 polygons and 9266 vertices.
Processing object from 3DS-file: Ayna_dikiz
Object 'Ayna_dikiz_jPCT24' created using 2176 polygons and 1135 vertices.
Processing object from 3DS-file: Anten
Object 'Anten_jPCT25' created using 1200 polygons and 624 vertices.
Processing object from 3DS-file: Box04
Object 'Box04_jPCT26' created using 3264 polygons and 1634 vertices.
Processing object from 3DS-file: pedals
Object 'pedals_jPCT27' created using 3168 polygons and 1611 vertices.
Processing object from 3DS-file: vites1
Object 'vites1_jPCT28' created using 1888 polygons and 1120 vertices.
Processing object from 3DS-file: vites2
Object 'vites2_jPCT29' created using 1872 polygons and 949 vertices.
Processing object from 3DS-file: hands
Object 'hands_jPCT30' created using 2528 polygons and 1424 vertices.
Processing object from 3DS-file: Object09
Object 'Object09_jPCT31' created using 3520 polygons and 1841 vertices.
Processing object from 3DS-file: Plane01
Object 'Plane01_jPCT32' created using 6048 polygons and 3162 vertices.
Processing object from 3DS-file: cam_arka
Object 'cam_arka_jPCT33' created using 2192 polygons and 1149 vertices.
Processing object from 3DS-file: cam
Object 'cam_jPCT34' created using 3584 polygons and 1890 vertices.
Processing object from 3DS-file: cam_kelebe
Object 'cam_kelebe_jPCT35' created using 1712 polygons and 910 vertices.
Processing object from 3DS-file: cam_cita
Object 'cam_cita_jPCT36' created using 1664 polygons and 890 vertices.
Processing object from 3DS-file: Plaka01
Object 'Plaka01_jPCT37' created using 2624 polygons and 1341 vertices.
Processing object from 3DS-file: Object02
Object 'Object02_jPCT38' created using 912 polygons and 481 vertices.
Processing object from 3DS-file: bagaj0
Object 'bagaj0_jPCT39' created using 14240 polygons and 7357 vertices.
Processing object from 3DS-file: Text01
Object 'Text01_jPCT40' created using 3692 polygons and 1854 vertices.
Processing object from 3DS-file: Arma03
Object 'Arma03_jPCT41' created using 1354 polygons and 679 vertices.
Processing object from 3DS-file: kapi
Object 'kapi_jPCT42' created using 10592 polygons and 5429 vertices.
Processing object from 3DS-file: Object07
Object 'Object07_jPCT43' created using 37232 polygons and 19851 vertices.
Processing object from 3DS-file: Object06
Object 'Object06_jPCT44' created using 1688 polygons and 952 vertices.
Processing object from 3DS-file: Plane09
Object 'Plane09_jPCT45' created using 1536 polygons and 813 vertices.
Processing object from 3DS-file: Plane08
Object 'Plane08_jPCT46' created using 3592 polygons and 1868 vertices.
Processing object from 3DS-file: ayna
Object 'ayna_jPCT47' created using 10504 polygons and 5518 vertices.
Processing object from 3DS-file: c_sutun0
Object 'c_sutun0_jPCT48' created using 5632 polygons and 2980 vertices.
Processing object from 3DS-file: Plane05
Object 'Plane05_jPCT49' created using 1344 polygons and 751 vertices.
Processing object from 3DS-file: Plane03
Object 'Plane03_jPCT50' created using 3552 polygons and 1877 vertices.
Processing object from 3DS-file: tavan0
Object 'tavan0_jPCT51' created using 4544 polygons and 2399 vertices.
Processing object from 3DS-file: ayna.ayna0
Object 'ayna.ayna0_jPCT52' created using 10504 polygons and 5514 vertices.
Processing object from 3DS-file: kapi.kapi0
Object 'kapi.kapi0_jPCT53' created using 10592 polygons and 5429 vertices.
Processing object from 3DS-file: Cylinder01
Object 'Cylinder01_jPCT54' created using 5248 polygons and 2841 vertices.
Processing object from 3DS-file: Torus01
Object 'Torus01_jPCT55' created using 28288 polygons and 14605 vertices.
Processing object from 3DS-file: Arma04
Object 'Arma04_jPCT56' created using 1354 polygons and 679 vertices.
Processing object from 3DS-file: Far
Object 'Far_jPCT57' created using 5928 polygons and 3131 vertices.
Processing object from 3DS-file: far_cam
Object 'far_cam_jPCT58' created using 1648 polygons and 857 vertices.
Processing object from 3DS-file: Arma1
Object 'Arma1_jPCT59' created using 1344 polygons and 672 vertices.
Processing object from 3DS-file: Arma2
Object 'Arma2_jPCT60' created using 116 polygons and 60 vertices.
Processing object from 3DS-file: Shape01
Object 'Shape01_jPCT61' created using 10 polygons and 7 vertices.
Processing object from 3DS-file: Lastil04
Object 'Lastil04_jPCT62' created using 10296 polygons and 5852 vertices.
Processing object from 3DS-file: Box36
Object 'Box36_jPCT63' created using 16848 polygons and 8835 vertices.
Processing object from 3DS-file: Cylinder38
Object 'Cylinder38_jPCT64' created using 4032 polygons and 2018 vertices.
Processing object from 3DS-file: Arma05
Object 'Arma05_jPCT65' created using 1354 polygons and 679 vertices.
Processing object from 3DS-file: Gengon02
Object 'Gengon02_jPCT66' created using 100 polygons and 60 vertices.
Processing object from 3DS-file: Box06
Object 'Box06_jPCT67' created using 512 polygons and 277 vertices.
Processing object from 3DS-file: Box36.Box4
Object 'Box36.Box4_jPCT68' created using 16848 polygons and 8835 vertices.
Processing object from 3DS-file: Box36.Box3
Object 'Box36.Box3_jPCT69' created using 16848 polygons and 8835 vertices.
Processing object from 3DS-file: Box36.Box0
Object 'Box36.Box0_jPCT70' created using 16848 polygons and 8835 vertices.
Java version is: 1.5.0_09
-> support for BufferedImage
Version helper for 1.2+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
[ Wed Mar 04 15:08:43 CST 2009 ] - WARNING: You've exceeded the configured triangle limit for the visibility list. Consider adjusting Config.maxPolysVisible![/font]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: object setTexture
« Reply #1 on: March 04, 2009, 08:51:01 am »
You have to add your textures to the TextureManager using the names that are defined in the 3ds file. The Loader doesn't load the textures for you, it just ask the TextureManager for it and creates dummies if none are found. Read more here: http://www.jpct.net/forum2/index.php/topic,962.0.html

BTW: In your example, loading of the texture fails...and your visibility list is too small (and your model seems to be rather large...i hope that this is for testing purposes only... ;)).