initial commit

This commit is contained in:
Victor Giers
2021-07-12 00:03:57 +02:00
commit 89227c151a
42 changed files with 4188659 additions and 0 deletions

BIN
PlayerCharacter.bin Normal file

Binary file not shown.

1
PlayerCharacter.gltf Normal file

File diff suppressed because one or more lines are too long

BIN
img/splashscreen.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

25
painted_world.css Normal file
View File

@@ -0,0 +1,25 @@
body {
font-family: Monospace;
background-color: #222222;
margin: 0px;
overflow: hidden;
}
#container {
background-image: url('img/splashscreen.jpg');
margin: 50px auto;
width:1024px;
height:768px;
}
.v3d-canvas {
position:inherit;
}
#overlay{
background-color: rgba(0,0,0,0);
z-index: 2;
width: inherit;
height: inherit;
}

23
painted_world.html Normal file
View File

@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Painted World</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="author" content="Victor Giers">
<script
src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="painted_world.css">
</head>
<body>
<div id="container"><div id="overlay"></div></div>
<script src="v3d.js"></script>
<script src="painted_world.js"></script>
</body>
</html>

240
painted_world.js Normal file
View File

@@ -0,0 +1,240 @@
'use strict';
var ctxSettings = {};
ctxSettings.alpha = true;
ctxSettings.preserveDrawingBuffer = true;
var app = new v3d.App('container', ctxSettings, null);
app.clearBkgOnLoad = true;
app.renderer.setClearColor(0x000000, 0);
app.renderCallbacks.push(renderCb);
app.compileCallbacks.push(compileCb);
var pause = false, loading = false;
function compileCb(){
dof(0.0,200, 0.025, 1);
bloom(7.5, 0.2, 0.4);
}
var controllerMatrix;
app.loadScene('PlayerCharacter.gltf', function() {
app.run();
//app.enableControls();
controllerCam = app.scene.children.find(controllerCam => controllerCam.name == 'ControllerCam');
playerCharacter = app.scene.children.find(playerCharacter => playerCharacter.name == "PlayerRig");
switchField('s1', 'f1', 'sp1');
mainMenu = false;
});
$('document').ready(function(){
// switchField('s1', 'f1', 'sp1');
// mainMenu = false;
});
//var movingLeft, movingRight, movingUp, movingDown;
let mainMenu = true;
var playerCharacter;
var controllerCam;
var upDirector;
var groundPlane;
var fieldScene, fieldCollider, fieldPortals, fieldCamera;
var movementSpeed = 0.05;
let PI = 3.1416;
//var finishedLoading = false;
var playerPosition = new v3d.Vector3();
var nextPosition = new v3d.Vector3();
var colliderBoxes = [];
var portalBoxes = [];
function collides(vector){
/*
for(var i = 0; i < portalBoxes.length; i++){
if(portalBoxes[i].containsPoint(vector)){
var target = fieldPortals[i].userData.v3d.customProps.target.split(/[$-/:-?{-~!"^_`\[\]]/gi);
console.log(target[0] + " " + target[1] + " " + target[2]);
if(!loading){
switchField(target[0], target[1], target[2]);
return false;
}
}
}
*/
var collides = false;
colliderBoxes.forEach(function(box){
if(box.containsPoint(vector)){
collides = true;
}
});
return collides;
}
function renderCb(){
if(playerCharacter != undefined){
playerPosition.set(playerCharacter.position.x, playerCharacter.position.y-1.75, playerCharacter.position.z);
//if(finishedLoading){
for(var i = 0; i < portalBoxes.length; i++){
if(portalBoxes[i].containsPoint(playerPosition) && !loading){
loading = true;
var target = fieldPortals[i].userData.v3d.customProps.target.split(/[$-/:-?{-~!"^_`\[\]]/gi);
console.log(target[0] + " " + target[1] + " " + target[2]);
switchField(target[0], target[1], target[2]);
//finishedLoading = false;
//return false;
}
}
}
}
function switchField(scene, field, spawnpoint) {
//pause = true;
if(app.controls != undefined){
app.controls.dispose();
//app.unload(app.camera);
}
//controllerCam.position.set(0,1.75,0);
//controllerCam.applyMatrix4(controllerMatrix);
//playerCharacter
var fieldName = scene + field;
var fieldURI = "scenes/" + fieldName + "/" + fieldName + ".gltf";
var bgimageURI = "scenes/" + fieldName + "/" + fieldName + "_bg.png";
if(fieldScene != undefined){
app.setCamera(controllerCam);
app.unload(fieldScene);
}
app.appendScene(fieldURI, function(){
$("#container").css("background-image", "url(" + bgimageURI + ")");
$('#overlay').hide();
fieldScene = app.scene.children.find(fieldScene => fieldScene.name == 'Scene');
groundPlane = fieldScene.children.find(groundPlane => groundPlane.name == 'Ground');
console.log(fieldScene);
fieldCollider = fieldScene.children.filter(fieldCollider => fieldCollider.groupNames.includes('Collider'));
colliderBoxes = [];
for (let i = 0; i < fieldCollider.length; i++) {
colliderBoxes.push(new v3d.Box3());
colliderBoxes[i].copy(fieldCollider[i].geometry.boundingBox).applyMatrix4(fieldCollider[i].matrixWorld);
}
fieldPortals = fieldScene.children.filter(fieldPortals => fieldPortals.groupNames.includes('Portals'));
portalBoxes = [];
for (let i = 0; i < fieldPortals.length; i++) {
portalBoxes.push(new v3d.Box3());
portalBoxes[i].copy(fieldPortals[i].geometry.boundingBox).applyMatrix4(fieldPortals[i].matrixWorld);
}
fieldCamera = fieldScene.children.find(fieldCamera => fieldCamera.name == 'Camera');
app.setCamera(fieldCamera);
let spawnPoint = fieldScene.children.find(spawnPoint => spawnPoint.name == scene + "_" + field + "_" + spawnpoint);
//alles superkacke hier :D
controllerCam.position.set(0,1.75,0);
controllerCam.setRotationFromMatrix(spawnPoint.matrix);
playerCharacter.setRotationFromMatrix(spawnPoint.matrix);
controllerCam.applyMatrix4(spawnPoint.matrix);
app.enableControls();
app.controls.object = controllerCam;
loading = false;
}, fieldLoadProgress, fieldLoadError, true, true);
}
function fieldLoadProgress(progress){
//console.log(progress);
$('#overlay').show().css('background-color', 'rgba(0,0,0,' + progress / 100 + ')');
}
function fieldLoadError(error){
console.log("Error loading Field, dumping: " + error);
}
var cube;
document.addEventListener('keydown', function(event){
if(mainMenu){
/*
if(event.key == 'Enter'){
switchField('s1', 'f1', 'sp1');
mainMenu = false;
}
*/
} else {
/*
if(event.key == 'Enter'){
switchField('s1', 'f1', 'sp1');
}
if(event.key == 'p'){
pause = !pause;
}
if(event.key == '1'){
switchField('s1', 'f1', 'sp1');
}
if(event.key == '2'){
switchField('s1', 'f2', 'sp1');
}
if(event.key == '3'){
switchField('s1', 'f3', 'sp1');
}
if(event.key == '4'){
switchField('s1', 'f4', 'sp1');
}
if(event.key == '5'){
switchField('s1', 'f5', 'sp1');
}
*/
if(event.key == 'ArrowUp'){
playerCharacter.rotation.y = PI * 2;
}
if(event.key == 'ArrowDown'){
playerCharacter.rotation.y = PI;
}
if(event.key == 'ArrowLeft'){
playerCharacter.rotation.y = PI / 2;
}
if(event.key == 'ArrowRight'){
playerCharacter.rotation.y = PI + PI / 2;
}
}
});
document.addEventListener('keyup', function(event){
});
function dof(focus, aperture, maxblur, depthLeakThreshold) {
app.enablePostprocessing([{
type: 'dof',
focus: focus,
aperture: aperture,
maxblur: maxblur,
depthLeakThreshold: depthLeakThreshold
}]);
}
function bloom(threshold, strength, radius) {
app.enablePostprocessing([{
type: 'bloom',
threshold: threshold,
strength: strength,
radius: radius
}]);
}

Binary file not shown.

File diff suppressed because one or more lines are too long

BIN
scenes/s1f1/s1f1.bin Normal file

Binary file not shown.

BIN
scenes/s1f1/s1f1.blend Normal file

Binary file not shown.

BIN
scenes/s1f1/s1f1.blend1 Normal file

Binary file not shown.

1
scenes/s1f1/s1f1.gltf Normal file

File diff suppressed because one or more lines are too long

BIN
scenes/s1f1/s1f1_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

BIN
scenes/s1f1/s1f1_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 KiB

BIN
scenes/s1f1/s1f1_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 KiB

BIN
scenes/s1f1/s1f1_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

BIN
scenes/s1f2/s1f2.bin Normal file

Binary file not shown.

1
scenes/s1f2/s1f2.gltf Normal file

File diff suppressed because one or more lines are too long

BIN
scenes/s1f2/s1f2_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 KiB

BIN
scenes/s1f3/s1f3.bin Normal file

Binary file not shown.

1
scenes/s1f3/s1f3.gltf Normal file

File diff suppressed because one or more lines are too long

BIN
scenes/s1f3/s1f3_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 KiB

BIN
scenes/s1f4/s1f4.bin Normal file

Binary file not shown.

1
scenes/s1f4/s1f4.gltf Normal file

File diff suppressed because one or more lines are too long

BIN
scenes/s1f4/s1f4_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

BIN
scenes/s1f5/s1f5.bin Normal file

Binary file not shown.

1
scenes/s1f5/s1f5.gltf Normal file

File diff suppressed because one or more lines are too long

BIN
scenes/s1f5/s1f5_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

1
v3d.js Normal file

File diff suppressed because one or more lines are too long

BIN
workbench/Asset_Zoo.blend Normal file

Binary file not shown.

BIN
workbench/Empty_Scene.blend Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@@ -0,0 +1,28 @@
class DialogueBox {
String text;
int ID;
DialogueBox(String t) {
text = t;
ID = DialogueBoxNo;
DialogueBoxNo++;
String[] pages = text.split("\\f");
}
}
DialogueBox dbox;
int DialogueBoxNo = 0;
void setup() {
size(600, 400);
//noLoop();
dbox = new DialogueBox("Yo was geht\fSeite 2");
}
void draw() {
background(255);
}
void mouseClicked(){
}

4188335
workbench/ephebe.OBJ Normal file

File diff suppressed because it is too large Load Diff

BIN
workbench/painted_world.xcf Normal file

Binary file not shown.

BIN
workbench/splashscreen.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
workbench/wip.blend Normal file

Binary file not shown.

BIN
workbench/wip.blend1 Normal file

Binary file not shown.