Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Pages: [1]
Support / shadowhelper/projector help
« on: January 26, 2014, 09:29:50 pm »
I'm trying to use the shadowhelper and projector by following the advanced example on the wiki but can't get it right. Part of my models dissapears and part becomes invisible.

I have a cube (the player) that a light follows. - this is my only light source, ambient light is 0.

 Then I have 2 objects3Ds,
-the level that is rendered and is a reciever of shadows
-a large box (from primitives) that casts shadows

This is my code
Code: [Select]
        projector = new Projector();

        sh = new ShadowHelper(world, buffer, projector, 2048);
        sh.setAmbientLight(new Color(30, 30, 30));
        //sh.setLightMode(false); neither makes any difference




Code: [Select]
            projector.setPosition(player.getTransformedCenter());            //player is object3d that light follows

It sort of works on occasion, but parts of level are becoming transparent and looking bizzare. Am I doing something wrong with the code?

Support / lighting problem
« on: January 20, 2014, 11:12:09 pm »
Hi, I have a textured model and a light in my scene

Code: [Select]
l = new Light(world);
l.setIntensity(200, 200, 200);

my light follows my camera

I found though that because I was using one single poly for a huge wall, when I went near the center the wall lost all light, presumably because of how vertex lighting works, no light reached any of the corners.

So I split my wall into several individual peices (seperated by the beams running either way). attenuation is set to -1 in this screenshot. The result was fine for the middle parts, but the bottom and top row seem to be working the opposite way? Points nearest the camera, and so light source, are darkest?

(Also, does JPCT triangulate models when you load one in?)

Support / Importing OBJ from sketchup
« on: June 25, 2013, 05:38:23 am »
Has anyone succesfully imported OBJ files from sketchup, if so, how?

My model (block) is initially completed gray, I think its a problem with the MTL file, I'm seeing

Code: [Select]
map_Kd block_Textures/Concrete_Aggregate_Smoke.PNG
block_Textures is a folder sketchup created, that I deleted as I load them from some other place. My textures are added to the texturemanager just as the png name, so

Code: [Select]
Texture named Concrete_Aggregate_Smoke.PNG added to TextureManager!
So I changed the line in the MTL file to

Code: [Select]
map_Kd Concrete_Aggregate_Smoke.PNG
But still its just grey. If I delete that line entirely though its draw in one solid colour, roughly the right colour but not a texture

The OBJ file contains

Code: [Select]
mtllib block.mtl

Code: [Select]
usemtl Concrete_Aggregate_Smoke
 Anyone know what I am doing wrong?

Support / blit inaccuracy
« on: May 31, 2013, 11:27:59 pm »
Hey, I am blitting a portion of a texture (1024x256)

Code: [Select]
Which is working fine, but when I resize the window

Code: [Select]
if (Display.wasResized())
                buffer.resize(Display.getWidth(), Display.getHeight());

It no longer draws the portion that I want, and instead draws 1 extra pixels worth (so 26 instead of 25) and shrinks it to fill the 25 pixel space (baiscally it has a big white line under it on screen). It also shifts the entire drawing down by 1, so draws at 1 instead of 0 (both in Y and X). This is only when the Display is a odd number in height/width e.g. 801x601

Is this normal/what should I do to avoid this?

Pages: [1]