Author Topic: Requirement For 3ds To get Texture  (Read 5795 times)

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Requirement For 3ds To get Texture
« on: February 09, 2007, 11:29:31 am »
Hi every one I would like to know, what are the things, to take care in creating 3ds object. So that it can take texture like that in example JPCTDemo.java . Is it some particular kind of wall to be created? So that it can take texture at the inner wall.

Can I give different texture to different object in an environment? Can any on help me with small example.

I tried to load .3ds object in HelloWorld.jave I could do so but all objects in environment had same color. Can I put texture to different objects in same environment? How do I do it  some one could help me with small example for it?



With Regards
San
San14

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Requirement For 3ds To get Texture
« Reply #1 on: February 10, 2007, 02:06:05 pm »
Each object can have different textures as well as different polygons in an object can have different textures (which is a special feature of jPCT when compared to other engines). When you create a 3ds, you usually assign textures to the polygons which are named somehow ("humpel.jpg" for example). When loading this model, the loader asks the TextureManager for textures with these names and assigns them to the polygons. I.e. if your model uses "humpel.jpg" as a texture, you've to load this texture and add it to the TextureManager with the name "humpel.jpg" (the actual file name doesn't matter here) before loading the actual model, so that the 3ds-loader can find it. If it can't find it, it will print out a message that a new default texture (all white) with that name has been created and added to the manager.

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Requirement For 3ds To get Texture
« Reply #2 on: February 11, 2007, 06:50:39 am »
Hi EgonOlsen
  
    Thanks a lot. I have one more problem When i am loading one san.3ds object to the example JPCTDemo.java it gives me this error message. Can you tell suggest me why is it so.
Code: [Select]
Loading Texture...textures\ql9.jpg
Loading file 3ds\jyu00.3ds
File 3ds\jyu00.3ds loaded...4204 bytes
Processing new material DEFAULT!
Processing object from 3DS-file: DEFAULT  
Object 'DEFAULT   _jPCT0' created using 205 polygons and 163 vertices.
Loading file 3ds\ \san.3ds
[ Sat Feb 10 23:39:58 IST 2007 ] - ERROR: Couldn't read file 3ds\ \san.3ds
[ Sat Feb 10 23:39:58 IST 2007 ] - ERROR: Not a valid 3DS file!
Created 0 triangle-strips for object3 in 1 pass(es)
Building octree for 0 triangles!
Octree constructed with 1 nodes / 0 leafs.

With Regarda
San14
« Last Edit: February 15, 2008, 03:11:59 am by san14 »
San14

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Requirement For 3ds To get Texture
« Reply #3 on: February 11, 2007, 01:03:50 pm »
Must be the path...what kind of path should "3ds\ \san.3ds" be? Maybe you can post the call to the loader?

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Requirement For 3ds To get Texture
« Reply #4 on: February 13, 2007, 06:44:29 am »
Code: [Select]
Maybe you can post the call to the loader?

I have seen the paths, But still not coming could you plz tell me how do I post call to loader.

With Regards
San14
« Last Edit: February 15, 2008, 03:12:18 am by san14 »
San14

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Requirement For 3ds To get Texture
« Reply #5 on: February 13, 2007, 05:39:19 pm »
Quote from: "san14"
I have seen the paths, But still not coming could you plz tell me how do I post call to loader.
I'm sorry, but how should we know what you are doing without you giving at least the line in which you are trying to load the file? Just saying that it doesn't work doesn't enable anyone (at least not me) to help you.

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
Requirement For 3ds To get Texture
« Reply #6 on: February 13, 2007, 07:12:51 pm »
Maybe he though you were a god : )
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Requirement For 3ds To get Texture
« Reply #7 on: February 14, 2007, 11:17:49 am »
Sorry for that !!

I have put my 3ds object in same 3ds folder as same as jpct example. and changed the name of 3ds as  under in the code. But it is giving error.

Code: [Select]
Image Path:-
D:\F-Drive-Back-Up\workspace\Jpct\3ds\san.3ds

Change In Code:-
Object3D[] levelParts=Loader.load3DS("3ds"+c+"san.3ds",10f);

Code: [Select]
ERROR:-
Loading file 3ds\ \san.3ds
[Sat Feb 10 23:39:58 IST 2007 ] - ERROR: Couldn't read file 3ds\ san.3ds
[ Sat Feb 10 23:39:58 IST 2007 ] - ERROR: Not a valid 3DS file!
Created 0 triangle-strips for object3 in 1 pass(es)
Building octree for 0 triangles!
Octree constructed with 1 nodes / 0 leafs.


I am also trying to get camera coordinates. Which I am geting it through method
Code: [Select]
camera.getPosition();But I need to  make .XML of the camera positions(x,yz) I need to get those data in Vector. I am geting repeted values. can you suggest me for same. I am using same JPCTDemo.java If you need i will send entire code with  my 3ds and changes  for creating XML using JDom 3ds.


With Regards

San14
« Last Edit: February 15, 2008, 03:12:52 am by san14 »
San14

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Requirement For 3ds To get Texture
« Reply #8 on: February 14, 2007, 12:15:41 pm »
What is c in this case? If this

"3ds"+c+"san.3ds"

leads to this

3ds\ \san.3ds

it seems to me, that c is "\ \"...could that be?

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Re: Requirement For 3ds To get Texture
« Reply #9 on: March 10, 2007, 12:16:50 pm »
HI
    I how can i know what is the name given to texture to .3ds file,  In  JPCTDemo.java type example.
I have one .3ds object with some texture but i dont know what is the name given to its texture. I have to load and give texture when it gets loade in JPCTDemo.java  3ds object is geting loaded but is not taking texture.  Its taking default white color. I am geting errors. 1 for resize the texture  and not geting any texture other then one table in room.

   ??? My que is seeing to error can I find out what is the name given to 3ds objects texture so that i can change the .jpg name to get texture when i load it to environment


Loading Texture...textures\other\numbers.jpg
Loading Texture...textures\other\envmap.jpg
Loading Texture...textures\BEN.JPG
[ Sat Mar 10 04:34:06 PST 2007 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!
Loading Texture...textures\BENEDETI.JPG
[ Sat Mar 10 04:34:06 PST 2007 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!
Loading Texture...textures\BL1.jpg
Loading Texture...textures\BL2.jpg
Loading Texture...textures\BR1.jpg
Loading Texture...textures\BR2.jpg
[ Sat Mar 10 04:34:06 PST 2007 ] - WARNING: Unsupported Texture height...resizing to a height of 256 pixels!
Loading Texture...textures\BRICK MU.JPG
[ Sat Mar 10 04:34:06 PST 2007 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!
Loading Texture...textures\BRICK PA.JPG
[ Sat Mar 10 04:34:07 PST 2007 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!
Loading Texture...textures\BUBING.JPG
[ Sat Mar 10 04:34:07 PST 2007 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!
Loading Texture...textures\BW1.jpg
[ Sat Mar 10 04:34:07 PST 2007 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!
Loading Texture...textures\BW2.jpg
Loading Texture...textures\GR1.jpg
Loading Texture...textures\GRY1.jpg
Loading Texture...textures\MV1.jpg
Loading Texture...textures\PINK.jpg
Loading Texture...textures\RED1.jpg
[ Sat Mar 10 04:34:07 PST 2007 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!
Loading Texture...textures\RED2.jpg
Loading Texture...textures\ROOM_FLOOR.jpg
Loading Texture...textures\T1.jpg
[ Sat Mar 10 04:34:07 PST 2007 ] - WARNING: Unsupported Texture height...resizing to a height of 256 pixels!
Loading Texture...textures\T2.jpg
[ Sat Mar 10 04:34:07 PST 2007 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!
Loading Texture...textures\T3.jpg
[ Sat Mar 10 04:34:08 PST 2007 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!
Loading Texture...textures\T4.jpg
Loading Texture...textures\T5.jpg
[ Sat Mar 10 04:34:09 PST 2007 ] - WARNING: Unsupported Texture height...resizing to a height of 256 pixels!
Loading Texture...textures\tv.jpg
Loading file 3ds\jyu00.3ds
File 3ds\jyu00.3ds loaded...4204 bytes
Processing new material DEFAULT!
Processing object from 3DS-file: DEFAULT   
Object 'DEFAULT   _jPCT0' created using 205 polygons and 163 vertices.
Loading file 3ds\scene090.3ds
File 3ds\scene090.3ds loaded...210942 bytes
[ Sat Mar 10 04:34:09 PST 2007 ] - ERROR: Not a valid 3DS file!
Created 0 triangle-strips for object3 in 1 pass(es)
Building octree for 0 triangles!
Octree constructed with 1 nodes / 0 leafs.
Adding Lightsource: 0
Java version is: 1.5.0_06
-> support for BufferedImage
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Software renderer (OpenGL mode) initialized
105-125 -> using splitted buffer access!



San14

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Requirement For 3ds To get Texture
« Reply #10 on: March 10, 2007, 12:36:20 pm »
Your file doesn't seem to be in the correct format, as this message says:

[ Sat Mar 10 04:34:09 PST 2007 ] - ERROR: Not a valid 3DS file!

If it would be a valid 3ds file, you'll see the names of the missing textures printed out to the console. The error is not caused by missing textures but by an invalid file format.

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Re: Requirement For 3ds To get Texture
« Reply #11 on: March 16, 2007, 07:29:11 am »
Hi
Thanks EgonOlsen

I have changed .3ds object and it worked.
But I am not geting weapon in the seen I have changed it with crosshair. I tried with different coordinate  and translate  weapon.translate(0, 3, 5);

I have this pice of error

My question is:-
Does it loads the object and has problem with translte or texture it is looking for. I am not able to resolve the erorror


Loading file 3ds\crosshair1_200207.3DS
File 3ds\crosshair1_200207.3DS loaded...1472 bytes
Processing new material 01 - crosshair!
Processing object from 3DS-file: crosshair1
Object 'crosshair1_jPCT0' created using 44 polygons and 24 vertices.



With Regards
San
San14

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Requirement For 3ds To get Texture
« Reply #12 on: March 16, 2007, 07:41:09 am »
Loading is fine according to the log. It's most likely, the the crosshair is way of coordinate wise, so that you don't see it. Why don't you use a texture to blit a crosshair on screen. I've never seen a 3d crosshair being used... ???

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Re: Requirement For 3ds To get Texture
« Reply #13 on: March 16, 2007, 11:26:27 am »
Hi
 
Quote
Why don't you use a texture to blit a crosshair on screen.

Can you suggest me how to do it. I want small cross hair on screen. But i am going to take camera coodinates to what object it points. Will camera coodnates and croshair give same coordinates?


With Regards

San
San14

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Requirement For 3ds To get Texture
« Reply #14 on: March 16, 2007, 12:19:34 pm »
 ??? Just draw a crosshair to a texture and blit that in the center of the screen. For picking the object to which the crosshair points, have a look here: http://www.jpct.net/forum2/index.php/topic,82