Fresher to JPCT

Started by san14, January 27, 2007, 06:59:56 AM

Previous topic - Next topic

san14

Hi I am fresher to JCPT. I have some silly questions.
I saw JPCT example at http://www.jpct.net/download.html . my question is, can i change ql.3ds to any other .3ds object in same example . Infect i tried with other may other examples of 3ds.. but it did not work.


With Thanks
San14
San14

EgonOlsen

"did not work" is a bit too vague...what exactly was the problem? Other files may have a different scaling, position in object space, orientation etc. So loading them just by replacing the name may work technically but you can't see the result, because it's behind you or one pixel small etc. I suggest to use a HelloWorld example (like in this thread: http://www.jpct.net/forum/viewtopic.php?t=734) and load the 3ds model into that one. It's easier to understand how the models differ from each other that way.

P.S.: I've moved your other thread to this forum too. They didn't belong to the news-section.

san14

hi
>>did not work" is a bit too vague...what exactly was the problem?
Problem was i could see black screen but could see the weapon.3ds. Sure i will try for different scaling
Object3D[] levelParts=Loader.load3DS("3ds"+c+"ksr00.3ds", 5f); Do this fragment has soming to do with scaling. if so I tried ("3ds"+c+"ksr00.3ds", 30f) to 1f.

Can i laoad .obj object instade of .3Ds

With Regards
San14

EgonOlsen

Yes, the last part is the scaling (as mentioned in the Javadocs btw.). If you see a black screen, it's most likely caused by the model's position in object space. Not all models are located around (0,0,0). Plus, the fps-example allies gravity, so if you are not located inside the model after loading you just fall down into infinity and can't see the model anymore. That's why i suggested to  use a modified HelloWorld instead which doesn't do all this application logic. That makes it much easier to understand the basics.
OBJ can be loaded with the new beta version. Have a look in the News-section for a download link.

san14

Thanks for your suggesion. I will try to go through HeloWorld example. But if scaling part is done in this example. Then it would be of great help to me. As it si doing every part what is required.

>>Not all models are located around (0,0,0).
Is there any means to find the loaction of 3ds object  (0,0,0).
San14

EgonOlsen

Quote from: "san14">>Not all models are located around (0,0,0).
Is there any means to find the loaction of 3ds object  (0,0,0).
No, but you can use Object3D.getCenter(); (after calling build() on that object) for something similar. It gives you a SimpleVector containing the geometrical center (as jPCT has calculated it) of an Object3D.