Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Kristers/3D/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ var objekti = [
[-150, 50, 0, 0, 0, 0, 25, 25, "yellow", 1], //grīda
//[0]x, [1]y, [2]z, [3]rx, [4]ry, [5]rz, [6]width, [7]height, [8]color, [9]opacity, [10]tekstūras mērogošana

[-150, 25, 700, 0, 0, 0, 25, 25, "red", 1], //grīda
//[0]x, [1]y, [2]z, [3]rx, [4]ry, [5]rz, [6]width, [7]height, [8]color, [9]opacity, [10]tekstūras mērogošana
[-140, 50, 710, 0, 0, 0, 20, 20, "url/textures/object.jpg", 1],
[-140, 50, 690, 0, 0, 0, 20, 20, "green", 1],
[-150, 50, 700, 0, 90, 0, 20, 20, "blue", 1],
[-130, 50, 700, 0, 90, 0, 20, 20, "blue", 1],

[-600, 0, 340, 0, 0, 0, 25, 25, "green", 1], //grīda
//[0]x, [1]y, [2]z, [3]rx, [4]ry, [5]rz, [6]width, [7]height, [8]color, [9]opacity, [10]tekstūras mērogošana
[-600, 50, 340, 0, 0, 0, 25, 25, "green", 1],

[600, -25, 340, 0, 0, 0, 25, 25, "white", 1], //grīda
//[0]x, [1]y, [2]z, [3]rx, [4]ry, [5]rz, [6]width, [7]height, [8]color, [9]opacity, [10]tekstūras mērogošana
[600, 50, 340, 0, 0, 0, 25, 25, "white", 1],
];

var pressUp = 0;
Expand Down Expand Up @@ -321,6 +321,7 @@ function coorReTransform(x3, y3, z3, rxc, ryc, rzc) {
function zimetObjektus(mansObj) {
for (let i = 0; i < mansObj.length; i++) {
let jaunsObjekts = document.createElement("div");
jaunsObjekts.style.position = "absolute";
jaunsObjekts.className = "objekts";
jaunsObjekts.id = `objekts${i}`;
jaunsObjekts.style.width = `${mansObj[i][6]}px`;
Expand All @@ -333,6 +334,7 @@ function zimetObjektus(mansObj) {
}px) rotateX(${mansObj[i][3]}deg) rotateY(${mansObj[i][4]}deg) rotateZ(${
mansObj[i][5]
}deg)`;
jaunsObjekts.style.backgroundSize = "200px";
world.append(jaunsObjekts);
}
}
Expand Down
Binary file added Kristers/3D/textures/object.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.