Textures in applet shifted

Started by fireside, August 01, 2008, 11:00:55 PM

Previous topic - Next topic

fireside

I just tried loading the mouse character in my applet and the textures that were fine in the application are all shifted over in the applet. 
click here->Fireside 7 Games<-

EgonOlsen

Do you have a screen shot to compare both?

fireside



These are the same model and texture.  One only uses ambient light, but you can see how the black nose is in the right place on the one and off on the other.
click here->Fireside 7 Games<-

EgonOlsen

Have you called build() on the model used in the applet. There is no difference between an applet and an application for jPCT. If the mapping is wrong, it has to be something in your code that differs. Are you using the hardware renderer in the application and the software one in the applet?

fireside

#4
I'm using the same model loading function except the applet loads from a stream and I'm using the software renderer for the applet.  The load function does a build. Then I set the texture after in both programs.  I do a set scale in the applet after the load and texture setting that I don't think I do in the application.
click here->Fireside 7 Games<-

EgonOlsen

You have to call build() after setting the textures. build() should be called right after the object is "ready to render". Without properly set textures, it isn't. The hardware renderer is just more forgiving in this respect than the software one.

fireside

click here->Fireside 7 Games<-

fireside

click here->Fireside 7 Games<-

EgonOlsen

You may also use recreateTextureCoords(); which is cheaper than build() if build() has already been called at least once before. But on todays hardware, it shouldn't matter anyway...