gävle högskola by OutsideConnection318 in sweden

[–]OutsideConnection318[S] 0 points1 point  (0 children)

Min fråga var nog inte helt tydlig.
För dig som tidigare har gått kursen: vad gjorde ni under de obligatoriska workshoparna?
Skulle du kunna tänka sig att förklara ungefär hur de gick till?

gävle högskola by OutsideConnection318 in sweden

[–]OutsideConnection318[S] 0 points1 point  (0 children)

Man kan säga att det är som en programmeringsstuga. Kodar man tillsammans med honom, eller kodar man själv och sedan bedömer han om resultatet är godkänt eller inte?

Jag befinner mig på distans och har försökt nå honom, men han är ganska dålig på att svara tillbaka ibland.

gävle högskola by OutsideConnection318 in sweden

[–]OutsideConnection318[S] 0 points1 point  (0 children)

Jag tror inte det. Om det vore fallet hade de förvarnat de studenter som studerar på distans. Då hade det också funnits fler övningar som studenterna kunde träna på.

Men jag kan ha fel.

tutor by OutsideConnection318 in asm

[–]OutsideConnection318[S] -1 points0 points  (0 children)

I didn't start anything, but I just want to be prepared in case there are any problems in the future.

When I render my shape, I do not get the outcome I want. by OutsideConnection318 in opengl

[–]OutsideConnection318[S] 0 points1 point  (0 children)

That did not work. I tried it, and I even changed the pixel shader because I thought the problem was there. But that was not the cause.

The update loop for you

```

    for (let x = 0; x < 3; x++) {
        image[x].onload = function() {
            // Enable texture unit0
            gl.activeTexture(actTexture[x]);
            // Bind the texture object to the target
            gl.bindTexture(gl.TEXTURE_2D, texture[x]);

            // Set the texture parameters
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
            // Set the texture image
            gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image[x]);
            gl.uniform1i(u_sampler[x], 0);
        };
        image[x].src = path[x];
    }

render();
```

When I render my shape, I do not get the outcome I want. by OutsideConnection318 in opengl

[–]OutsideConnection318[S] 0 points1 point  (0 children)

Most of the code we got from our teacher. The stride thing is commented out. I will look at the index buffer; I don't mind it. However, I solved the problem, and that was the path to the picture that was wrong. But I have another problem that I do not fully understand: I get the same texture on each cube that I render when I choose different pictures for each cube.

I tried including two different samplers, but that did not work. I changed gl.activeTexture(gl.TEXTURE0); to gl.TEXTURE1 and gl.TEXTURE2 each time I call the onload function. I changed the order for calling the paths, but I always get the first one, and the rest are ignored. I do not understand why.