Code Monkey home page Code Monkey logo

kons-9's Introduction

I am a long-time 3D graphics developer, with an interest in Common Lisp.

Some highlights:

  • MIT mathematics degree
  • developed some of the earliest 3D CG software for Symbolics Lisp Machines
  • wrote animation software used in “Jurassic Park”
  • software R&D lead on “Final Fantasy: The Spirits Within” movie
  • senior software developer on “The Hobbit” films

Currently designing and developing 3D software in Common Lisp (CCL on MacOS) as an open-ended research project.

More info about the project at my blog: https://kaveh808.medium.com

UPDATE:

The 3D software is now an open source project in the kons-9 repo. It has been moved to SBCL and runs on MacOS and Linux.

kons-9's People

Contributors

awolven avatar bigos avatar foretspaisibles avatar jmc-design avatar kaiwulf avatar kaveh808 avatar kayomarz avatar lukego avatar mikelevins avatar nsmoker avatar

Stargazers

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

Watchers

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

kons-9's Issues

get mouse dragging working

Thanks to @jolby and @mikelevins , we now have a branch for testing the SBCL port: merge-ccl-sbcl.

Can someone with GLFW experience see about getting the mouse-dragged function in minimal-ui.lisp working so we can have 3D navigation? You can copy the code for mouse navigation from the CCL folder, or just get the function to be called and I'll do the rest.

Optimize OpenGL Drawing

Use vertex arrays and the like to speed up the current naive drawing code in opengl.lisp.

Explore Vulkan graphics

An idea...

We could take opengl.lisp as our display API and see if we can write a drop-in replacement using Vulkan.

bug: src/kernel/item not loaded

kons-9.asd does not load src/hernel/item.lisp in commit e85f7d9.

Adding (:file "src/kernel/scene-item") to the components before (:file "src/kernel/scene") appears to resolve the issue.

add find-closest-point method

Implement a method find-closest-point for the class polyhedron. Ignore the shape's transform.

The returned point must be on the surface of a face, on an edge, or at a vertex or the polyhedron.

Text engine problem - black window

Branch: main
Platform: Devuan GNU/Linux x86_64, SBCL version 2.1.1.
Commit: 7ff3015
I have downloaded the latest sources and now when I try to start (run) or (run-1) I get a black window or a window with the background as in the gif. If I comment (:file "src/graphics/opengl/text") in kons-9.asd and the lines corresponding to the text engine in minimal-ui.lisp the window starts correctly. I think Kaveh had the same problem. I will investigate, see if I can make in work.

Peek 2022-09-03 11-28

Problem running kons-9

The problem is most likely because this system is so ancient, but FYI I was unsuccessful trying to run kons-9 on my only remaining Apple H/W:

Mac OS X 10.6.8
CCL 1.3

ASDF could not load kons-9 because Objective-C runtime exception:
-[NSCachedWhiteColor CGColor]: unrecognized selector sent to instance 0x146120.

Error: Objective-C runtime exception:
-[NSCachedWhiteColor CGColor]: unrecognized selector sent to instance 0x146120
While executing: CCL::CHECK-NS-EXCEPTION, in process Listener(4).

motion is-active? demo

When an object becomes inactive and then activated some time later, it will jump to the position it would have been in had it not been inactive.
Is this the desired behaviour, or should an object resume from where it was left off?

Implement 3d picking of shapes

[Need someone for this.]

Initially by clicking on just shapes in the 3D view.

Requires some knowledge of OpenGL.

Later, it can be extended to mesh parts (face, edge, vertex) of poly-mesh at some point.

SBCL Port

Here will be some things needed for SBCL to work, platform independent

Reorganize demos

  • Split into different files.
  • More documentation.
  • Better organization.

demo-uv-mesh error

Branch: main
Commit: 7ff3015
Platform: Devuan GNU/Linux x86_64, SBCL version 2.1.1

When I try to run the first demo in demo-uv-mesh.lisp I get the following error:

The value
  (#(1.5 0.0 0.0 1.0) #(-1.5 0.0 0.0 1.0))
is not of type
  VECTOR
when binding #:LOOP-ACROSS-VECTOR-0
   [Condition of type TYPE-ERROR]

Restarts:
 0: [ABORT] Abort compilation.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "worker" RUNNING {100454B3B3}>)

Backtrace:
  0: (TRANSFORM-POINTS! (#(1.5 0.0 0.0 1.0) #(-1.5 0.0 0.0 1.0)) #2A((1.0 0.0 0.0 0.0) (0.0 1.0 0.0 0.0) (0.0 0.0 1.0 0.0) (0.0 0.0 -0.75 1.0)))
  1: ((:METHOD SWEEP-EXTRUDE-AUX (UV-MESH T T T T)) #<UV-MESH UV-MESH-10, 0 points, 0 faces, dims (2 2) {100459FC43}> (#(1.5 0.0 0.0 1.0) #(-1.5 0.0 0.0 1.0)) NIL #(#(0.0 0.0 -0.75 1.0) #(0.0 0.0 0.75 1.0)..
  2: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /tmp/slimeMEUJRN.fasl" {100459C673}> :TABLE #(8 #<PACKAGE "KONS-9"> CLEAR-SCENE SYMBOL-VALUE *SCENE* ADD-SHAPE .....
  3: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /tmp/slimeMEUJRN.fasl" {100459C673}> NIL NIL)
  4: ((FLET SB-FASL::THUNK :IN LOAD))
  5: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (FLET SB-FASL::THUNK :IN LOAD) {7FEA3CB7DE4B}> #<SB-SYS:FD-STREAM for "file /tmp/slimeMEUJRN.fasl" {100459C673}>)
  6: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-SYS:FD-STREAM for "file /tmp/slimeMEUJRN.fasl" {100459C673}> T)
  7: (LOAD #P"/tmp/slimeMEUJRN.fasl" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
  8: ((FLET SWANK/BACKEND:CALL-WITH-COMPILATION-HOOKS :IN "/home/starkaiser/.emacs.d/elpa/slime-20220712.817/swank/sbcl.lisp") #<FUNCTION (LAMBDA NIL :IN SWANK/BACKEND:SWANK-COMPILE-STRING) {100459C52B}>)
  9: ((FLET SWANK/BACKEND:SWANK-COMPILE-STRING :IN "/home/starkaiser/.emacs.d/elpa/slime-20220712.817/swank/sbcl.lisp") "(with-clear-scene ..)
 10: ((LAMBDA NIL :IN SWANK:COMPILE-STRING-FOR-EMACS))
 11: ((LAMBDA NIL :IN SWANK::COLLECT-NOTES))
 12: (SWANK::MEASURE-TIME-INTERVAL #<FUNCTION (LAMBDA NIL :IN SWANK::COLLECT-NOTES) {10023A7ECB}>)
 13: (SWANK::COLLECT-NOTES #<FUNCTION (LAMBDA NIL :IN SWANK:COMPILE-STRING-FOR-EMACS) {10023A7E7B}>)
 14: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<FUNCTION (LAMBDA NIL :IN SWANK:COMPILE-STRING-FOR-EMACS) {10023A7E2B}>)
 15: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:COMPILE-STRING-FOR-EMACS "(with-clear-scene ..)
 16: (EVAL (SWANK:COMPILE-STRING-FOR-EMACS "(with-clear-scene ..)
 17: (SWANK:EVAL-FOR-EMACS (SWANK:COMPILE-STRING-FOR-EMACS "(with-clear-scene ..)
 18: ((LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD))
 19: (SWANK/SBCL::CALL-WITH-BREAK-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD) {52BFC9CB}>)
 20: ((FLET SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/starkaiser/.emacs.d/elpa/slime-20220712.817/swank/sbcl.lisp") #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORK..
 21: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-INPUT* . #<SWANK/GRAY::SLIME-INPUT-STREAM {1002543E53}>)) #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD) {52BFCC3B}>)
 22: ((LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD))
 23: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
 24: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::RUN))
 25: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
 26: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::RUN))
 27: (SB-THREAD::RUN)
 28: ("foreign function: call_into_lisp")
 29: ("foreign function: funcall1")

Similar for demo 07. All other demos work.

The value
  (#(-0.5 -9.184851e-17 0.0 1.0) #(6.123234e-17 -0.5 0.0 1.0)
   #(0.5 3.061617e-17 0.0 1.0) #(0.0 0.5 0.0 1.0))

is not of type
  VECTOR
when binding #:LOOP-ACROSS-VECTOR-0
   [Condition of type TYPE-ERROR]

Restarts:
 0: [ABORT] Abort compilation.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "worker" RUNNING {10018F3753}>)

Backtrace:
  0: (TRANSFORM-POINTS! (#(-0.5 -9.184851e-17 0.0 1.0) #(6.123234e-17 -0.5 0.0 1.0) #(0.5 3.061617e-17 0.0 1.0) #(0.0 0.5 0.0 1.0)) #2A((0.874994019659956d0 -0.27896714553936425d0 -0.3956803937935073d0 0.0..
  1: ((:METHOD SWEEP-EXTRUDE-AUX (UV-MESH T T T T)) #<UV-MESH UV-MESH-12, 0 points, 0 faces, dims (4 65) {1001977063}> (#(-0.5 -9.184851e-17 0.0 1.0) #(6.123234e-17 -0.5 0.0 1.0) #(0.5 3.061617e-17 0.0 1.0..
  2: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /tmp/slimegpC8yR.fasl" {10019712B3}> :TABLE #(17 #<PACKAGE "KONS-9"> CLEAR-SCENE SYMBOL-VALUE *SCENE* MAKE-SINE-CU..
  3: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /tmp/slimegpC8yR.fasl" {10019712B3}> NIL NIL)
  4: ((FLET SB-FASL::THUNK :IN LOAD))
  5: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (FLET SB-FASL::THUNK :IN LOAD) {7FEA3CB7DE4B}> #<SB-SYS:FD-STREAM for "file /tmp/slimegpC8yR.fasl" {10019712B3}>)
  6: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-SYS:FD-STREAM for "file /tmp/slimegpC8yR.fasl" {10019712B3}> T)
  7: (LOAD #P"/tmp/slimegpC8yR.fasl" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
  8: ((FLET SWANK/BACKEND:CALL-WITH-COMPILATION-HOOKS :IN "/home/starkaiser/.emacs.d/elpa/slime-20220712.817/swank/sbcl.lisp") #<FUNCTION (LAMBDA NIL :IN SWANK/BACKEND:SWANK-COMPILE-STRING) {100197116B}>)
  9: ((FLET SWANK/BACKEND:SWANK-COMPILE-STRING :IN "/home/starkaiser/.emacs.d/elpa/slime-20220712.817/swank/sbcl.lisp") "(with-clear-scene ..)
 10: ((LAMBDA NIL :IN SWANK:COMPILE-STRING-FOR-EMACS))
 11: ((LAMBDA NIL :IN SWANK::COLLECT-NOTES))
 12: (SWANK::MEASURE-TIME-INTERVAL #<FUNCTION (LAMBDA NIL :IN SWANK::COLLECT-NOTES) {100196076B}>)
 13: (SWANK::COLLECT-NOTES #<FUNCTION (LAMBDA NIL :IN SWANK:COMPILE-STRING-FOR-EMACS) {100196071B}>)
 14: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<FUNCTION (LAMBDA NIL :IN SWANK:COMPILE-STRING-FOR-EMACS) {10019606CB}>)
 15: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:COMPILE-STRING-FOR-EMACS "(with-clear-scene ..)
 16: (EVAL (SWANK:COMPILE-STRING-FOR-EMACS "(with-clear-scene ..)
 17: (SWANK:EVAL-FOR-EMACS (SWANK:COMPILE-STRING-FOR-EMACS "(with-clear-scene ..)
 18: ((LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD))
 19: (SWANK/SBCL::CALL-WITH-BREAK-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD) {52BFC9CB}>)
 20: ((FLET SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/starkaiser/.emacs.d/elpa/slime-20220712.817/swank/sbcl.lisp") #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORK..
 21: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-INPUT* . #<SWANK/GRAY::SLIME-INPUT-STREAM {1002543E53}>)) #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD) {52BFCC3B}>)
 22: ((LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD))
 23: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
 24: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::RUN))
 25: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
 26: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::RUN))
 27: (SB-THREAD::RUN)
 28: ("foreign function: call_into_lisp")
 29: ("foreign function: funcall1")

plugin/procedural-polygon fails to compile

Branch: main
Commit: [7ff3015]
Platform: macOS 12.5.1, SBCL 2.2.6

Steps to reproduce:

  1. Start SBCL
  2. Load kons-9.asdf
  3. (asdf:load-system :kons-9)

Expected result: System loads. Can create demo window.

Actual result: COMPILE-FILE-ERROR while compiling "src/plugins/procedural-polygon"

Compiling the file separately yields:
procedural-polygon.lisp:86:1:
warning:
Duplicate definition for MAKE-CIRCLE found in one file.
--> DEFUN PROGN
==>
(EVAL-WHEN (:COMPILE-TOPLEVEL)
(SB-C:%COMPILER-DEFUN 'KONS-9::MAKE-CIRCLE T NIL NIL))

Explore glop integration

Let's see if we can implement the glfw functionality using glop, which some of you prefer.

The idea would be a rewrite of minimal-ui.lisp using glop.

sbcl MacOS port

Port the system to sbcl/MacOS/OpenGL. Need to get off CCL, as it doesn't run on the M1 chip.

BUG: shading wrong when window re-opened

Looking for a volunteer for this.

This is a bug on both MacOS and Linux, so is probably an OpenGL issue.

Open window.
Create polyhedron.
Close window.
Open window.
Shading is much brighter.

I suspect some OpenGL state is not being reset properly.

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.