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
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.
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.
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
Must be the path...what kind of path should "3ds\ \san.3ds" be? Maybe you can post the call to the loader?
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
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.
Maybe he though you were a god : )
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.
Image Path:-
D:\F-Drive-Back-Up\workspace\Jpct\3ds\san.3ds
Change In Code:-
Object3D[] levelParts=Loader.load3DS("3ds"+c+"san.3ds",10f);
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 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
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?
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!
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.
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
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... ???
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
??? 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 (http://www.jpct.net/forum2/index.php/topic,82)