Skip to content

Commit

Permalink
new init
Browse files Browse the repository at this point in the history
  • Loading branch information
mudroljub committed Mar 24, 2023
0 parents commit aac3d26
Show file tree
Hide file tree
Showing 1,328 changed files with 329,385 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"rules": {
"array-bracket-spacing": ["warn", "never"],
"arrow-body-style": ["warn", "as-needed"],
"arrow-parens": ["warn", "as-needed"],
"arrow-spacing": "warn",
"block-scoped-var": "error",
"brace-style": ["warn", "1tbs"],
"class-methods-use-this": "warn",
"comma-spacing": ["warn", { "before": false, "after": true }],
"computed-property-spacing": ["warn", "never"],
"constructor-super": "error",
"curly": ["warn", "multi"],
"dot-notation": "warn",
"indent": ["warn", 2, { "SwitchCase": 1 }],
"key-spacing": ["warn", { "afterColon": true }],
"keyword-spacing": "warn",
"no-class-assign": ["error"],
"no-cond-assign": "error",
"no-const-assign": "error",
"no-dupe-args": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-duplicate-imports": "error",
"no-else-return": "error",
"no-global-assign": "error",
"no-invalid-this": "error",
"no-multi-spaces": ["warn", { "ignoreEOLComments": true }],
"no-multiple-empty-lines": ["warn", { "max": 1, "maxEOF": 1 }],
"no-param-reassign": "warn",
"no-redeclare": "error",
"no-return-assign": ["warn", "always"],
"no-shadow-restricted-names": "error",
"no-this-before-super": "error",
"no-trailing-spaces": "warn",
"no-undef": "error",
"no-unexpected-multiline": "error",
"no-unneeded-ternary": "warn",
"no-unreachable": "error",
"no-unused-private-class-members": "warn",
"no-unused-vars": ["warn", { "args": "after-used" }],
"no-use-before-define": ["error", { "functions": false }],
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-var": "error",
"object-curly-spacing": ["warn", "always"],
"object-shorthand": "warn",
"operator-assignment": ["warn", "always"],
"prefer-arrow-callback": "warn",
"prefer-const": "warn",
"prefer-destructuring": ["warn", {"object": true, "array": false}],
"prefer-spread": "error",
"quotes": ["warn", "single"],
"semi": ["warn", "never", { "beforeStatementContinuationChars": "always"}],
"semi-spacing": ["warn", {"before": false, "after": true}],
"space-before-blocks": "warn",
"space-before-function-paren": ["warn", "never"],
"space-in-parens": ["warn", "never"],
"space-infix-ops": "warn",
"spaced-comment": ["warn", "always"],
"vars-on-top": "error",
"yoda": ["error", "never", { "exceptRange": true }]
},
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true,
"jsx": true
}
}
}
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.DS_Store

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
198 changes: 198 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Create 3D worlds

Create 3D worlds with Three.js.

## Start

```
npm i
npx live-server
```

## TODO

- srediti git

Mazes:
- pregledati sve primere i refactor
- check putInMaze
- minas tirit srediti hodanje uzbrdo ili smanjiti brdo

### Scenes & examples

- FPS / Savo
- probati recursiveDivision
- pozicionirati igrača na najdalju tačku od izlaza (prvu tačku?)
- dodati izlaz iz lavirinta
- isprobati igru sa braid
- srediti audio

- FPS / Horror
- scena groblje

- RPG / Fantasy
- bug: ostaje raskečena nakon skoka (držati spejs i pustiti pred tlo)
- srediti borbu, previše promašuje
- da se ai ne približavaju previše
- bacanje magije (pogledati i shadere)
- slona
- dodati mač?
- karakter dolazi do kuće i ulazi (vidi house model primer)
- uzima predmete (50-rad-sa-modelima/80-uzimanje-predmeta/)

- Adventure / Avatar
- merge stairway-girl, stairway-to-heaven, tower-of-babel, random-boxes?
- avatar previše ide strafe?
- avatar zapinje uzbrdo (minas tirit maze)
- dodati DOUBLE_JUMP

- Svemir
- dodati model ring space-arcology
- dodati zvezdani svod
- bolja distribucija zvezda (perlin noise)
- probati letenje kroz zvezde
- sletanje na platformu (naći 2d primer)
- sletanje na mesec (textured moon)
- dodati proceduralnu planetu http://colordodge.com/ProceduralPlanet/?seed=Ridi%20Genow
- mozda iskoristiti astronauta da luta po planeti https://codepen.io/b29/pen/LoaRKx

Spomenici
- napraviti scenu sa jugoslovenskim spomenicima

- Zeppelin
- umesto createChaseCamera koristiti 3rd person?

- Aircraft / 1943
- dodati izbor aviona
- dodati drveće
- dodati objekte
- pucanje i eksplozije
- spojiti sa airplane?

- Tenk
- koristiti TankPlayer
- tenk da se trese kada ide
- ide kroz ratnu scenu (spaljene zgrade) i ruši stvari

- Vozilo
- vozilo da se okreću točkovi kada ide
- ispitati modele, jel moguće upravljati točkovima, kupolom ili nečim

- Endless runner
- probati skejtera
- probati konja ili dabra

- Partizani 2D
- napraviti 2d scenu u 3d, ideja https://codepen.io/davekwiatkowski/pen/pWPVpX
- junior general slike
- borba (vidi slike partizana animaciju staru)

- Groblje
- nasumično zakriviti kamenove

### Polishing

- probati dinamički import, učitavati neprijatelje (i objekte) tek kad su blizu
- prebaciti CameraFollow na Player?
- optimizovati modele https://github.com/donmccurdy/glTF-Transform
- obrisati sve što nije modularno
- dodati svuda toon-shader gde se slaže
https://www.maya-ndljk.com/blog/threejs-basic-toon-shader
https://summer-afternoon.vlucendo.com/
- dodati UI komande redom
- automatsko puštanje zvuka
- popraviti HTML margine
- optimizacija
- https://twitter.com/mrdoob/status/966609115140128768
- https://attackingpixels.com/tips-tricks-optimizing-three-js-performance/
- probati VR
- https://threejs.org/docs/#manual/en/introduction/How-to-create-VR-content
- https://ski-mountain-vr.herokuapp.com/
- dodati preloader po potrebi
- reuse main loop?
- pauzirati scenu na tab unfocus
- sve dobro dokumentovati

### Publish
- srediti root-relativne linkove da rade u podfolderu
- možda build proces, minifikacija, i sl.

## Helpers

Raycaster helper:

```js
scene.add(new THREE.ArrowHelper(raycaster.ray.direction, raycaster.ray.origin, 300))
```

Box helper:

```js
const box = new THREE.BoxHelper(mesh, 0xffff00)
scene.add(box)
```

Axes helper (X axis is red, Y is green, Z is blue):

```js
scene.add(new THREE.AxesHelper(50))
```

Ako je teren jednobojan, bez svetla, uraditi:

```js
geometry.computeVertexNormals()
```

## Documentation

All libraries in `/libs` folder are updated manually to support ES6 export.

### Ammo Physics

Some methods:

```js
body.setFriction(.9)
body.setRollingFriction(10)
body.setRestitution(.95)
body.setAngularVelocity(btVector3)
body.setLinearVelocity(btVector3)

// apply a force to the x-axis of the rigid body
const force = new Ammo.btVector3(10, 0, 0);
body.applyForce(force, new Ammo.btVector3(0, 0, 0));

// apply an impulse (very short duration force, like a punch or a kick) to the x-axis
body.applyImpulse(new Ammo.btVector3(10, 0, 0))

// jump
body.applyCentralImpulse(new Ammo.btVector3(0, mass * .5, 0))
```

## Sources

Examples are from theese great books and tutorials:

* 3D Game Programming for Kids (Chris Strom)
* [Interactive 3D Graphics](https://in.udacity.com/course/interactive-3d-graphics--cs291/) (Eric Haines)
* [Three.js tutorials by example](http://stemkoski.github.io/Three.js/) (Lee Stemkoski)
* [WebGL and Three.js Fundamentals](https://github.com/alexmackey/threeJsBasicExamples) (Alex Mackey)
* [Examples created by Yomotsu using THREE.js](http://yomotsu.github.io/threejs-examples/) (Akihiro Oyamada)
* [Learning Threejs](https://github.com/josdirksen/learning-threejs) (Jos Dirksen)
* [Essential Three.js](https://github.com/josdirksen/essential-threejs) (Jos Dirksen)
* [Three.js Cookbook](https://github.com/josdirksen/threejs-cookbook) (Jos Dirksen)
* [How to Design 3D Games with Web Technology - Book 01: Three. Js - HTML5 and WebGL](https://thefiveplanets.org/b01/) (Jordi Josa)

Free 3D Models are from:
- 3dwarehouse.sketchup.com
- sketchfab.com
- turbosquid.com
- mixamo.com
- archive3d.net
- rigmodels.com
and other respected sites.

Geodata:
- visinske mape za ceo svet https://tangrams.github.io/heightmapper/#8.3724/43.3401/19.5293
- weighted random https://pixelero.wordpress.com/2008/04/24/various-functions-and-various-distributions-with-mathrandom/
Binary file added assets/heightmaps/corsica.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heightmaps/earth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heightmaps/grandcanyon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heightmaps/montenegro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heightmaps/oos-heightmap-128.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heightmaps/stemkoski.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heightmaps/wiki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/heightmaps/yu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/bayer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/car-track.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/change-camera.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/crosshair-big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/crosshair.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/noise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/prva-proleterska.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/savo-big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/savo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/sfrj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions assets/models/aircraft/av-8/CK2QVW083JBVUYZDHDQJNSVGF.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
newmtl mat_0-av8b_body_fix.jpg
Ka 0.000000 0.000000 0.000000
Kd 0.698039 0.698039 0.698039
Ks 0.000000 0.000000 0.000000
d 1.000000
illum 2
Ns 9.84916
map_Kd av8b_body_fix.jpg

newmtl mat_1-default-grey.jpg
Ka 0.000000 0.000000 0.000000
Kd 0.698039 0.698039 0.698039
Ks 0.000000 0.000000 0.000000
d 1.000000
illum 2
Ns 9.84916
map_Kd default-grey.jpg

Loading

0 comments on commit aac3d26

Please sign in to comment.