Coder Social home page Coder Social logo

stephanreiter / jkview Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 4.0 6.16 MB

Jedi Knight & MotS 3D Preview

Home Page: https://forums.massassi.net/vb3/showthread.php?68093-Announcing-Jedi-Knight-amp-MotS-Level-3D-Preview

License: BSD 2-Clause "Simplified" License

Python 2.94% Shell 0.01% JavaScript 96.06% HTML 1.00%
webgl retrogaming jedi-knight 3d-graphics python

jkview's People

Contributors

dependabot[bot] avatar saberworks avatar stephanreiter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jkview's Issues

rotation seems anchored to start position

If I use the camera/keyboard to navigate somewhere inside the map, and then I use the mouse click+drag to rotate, it seems to be rotating the map about the original "player" start position, rather than the current "player" start position. This makes it a bit difficult to navigate to and view some areas.

feature request: error indicator

Some levels fail to load (see #2). In these cases, it would be nice if the client code could detect the error and show the user a friendly error message. Hopefully we could do it for all errors not just the ones we already know about.

feature request: sector/wireframe view

Would it be possible to have a toggle to show a wireframe/sector view? Kinda like the main JED view. I think it would be super cool to be able to see the wireframe as well.

some levels fail to load

Some levels fail to load. I don't know why, the error message isn't helpful to me. I was just going through some random levels and found that 325 and 328. The preview gives a blank screen. The log on the server says:

ERROR:flask.app:Exception on /level/325.js [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2311, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1834, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1737, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 36, in reraise
    raise value
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1832, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1818, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/3dpreview/server_cache.py", line 87, in decorated_function
    response = make_response(f(*args, **kwargs))
  File "server.py", line 65, in level_data
    gob_path, censor=censor)
  File "/usr/local/3dpreview/loader.py", line 183, in load_level_from_file
    return _load_level(b'jkl/' + info.levels[0], gobs=[target] + OFFICIAL, censor=OFFICIAL if censor else [])
  File "/usr/local/3dpreview/loader.py", line 134, in _load_level
    material_name = level.materials[surface['material']]
KeyError: -1
ERROR:flask.app:Exception on /level/328.js [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2311, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1834, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1737, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 36, in reraise
    raise value
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1832, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1818, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/3dpreview/server_cache.py", line 87, in decorated_function
    response = make_response(f(*args, **kwargs))
  File "server.py", line 65, in level_data
    gob_path, censor=censor)
  File "/usr/local/3dpreview/loader.py", line 183, in load_level_from_file
    return _load_level(b'jkl/' + info.levels[0], gobs=[target] + OFFICIAL, censor=OFFICIAL if censor else [])
  File "/usr/local/3dpreview/loader.py", line 134, in _load_level
    material_name = level.materials[surface['material']]
KeyError: -1

feature request: load from arbitrary URLs

Our friends at JKDF2.NET would also like to use jkview on their site. I am planning on looking into it maybe next month, but I am wondering if you have any ideas on how to make this work on other sites. It is pretty tied to massassi's level_ids which makes it problematic for JKDF2.NET.

Is there anything it's pulling from the level info page other than the download URL? I wonder if we could make a change to embed using the full download URL (and maybe a title or name or something?) instead of the massassi level id.

For example, currently massassi embeds like this:

<iframe src="https://3dpreview.massassi.net/level/3136/" scrolling="no" width="640" height="480"></iframe>

What if instead we could embed something like:

<iframe src="https://3dpreview.massassi.net/level?link=https://www.massassi.net/media/levels/files/jksp/FGR6.zip" scrolling="no" width="640" height="480"></iframe>

That way JKDF2.NET could do their own 3dpreview like:

<iframe src="https://3dpreview.jkdf2.net/level?link=https://www.jkdf2.net/download/a-jedis-discovery/?wpdmdl=27595&refresh=6201c36213c3c1644282722" scrolling="no" width="640" height="480"></iframe>

Any ideas on how to implement something like this?

I'm not even sure if they have the expertise to manage a python app server but thought I'd ask in case you see an easy path forward.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.