/.project
/.settings/
/doc/graphs/
-/sixth-3d.iml
\ No newline at end of file
+/doc/apidocs/
+/*.iml
\ No newline at end of file
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+ HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+ i. the right to reproduce, adapt, distribute, perform, display,
+ communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+ likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+ subject to the limitations in paragraph 4(a), below;
+ v. rights protecting the extraction, dissemination, use and reuse of data
+ in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+ European Parliament and of the Council of 11 March 1996 on the legal
+ protection of databases, and under any national implementation
+ thereof, including any amended or successor version of such
+ directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+ world based on applicable law or treaty, and any national
+ implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrupt the quiet enjoyment of the Work by the public
+as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason
+be judged legally invalid or ineffective under applicable law, then the
+Waiver shall be preserved to the maximum extent permitted taking into
+account Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each affected
+person a royalty-free, non transferable, non sublicensable, non exclusive,
+irrevocable and unconditional license to exercise Affirmer's Copyright and
+Related Rights in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty (including future
+time extensions), (iii) in any current or future medium and for any number
+of copies, and (iv) for any purpose whatsoever, including without
+limitation commercial, advertising or promotional purposes (the
+"License"). The License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the License for any
+reason be judged legally invalid or ineffective under applicable law, such
+partial invalidity or ineffectiveness shall not invalidate the remainder
+of the License, and in such case Affirmer hereby affirms that he or she
+will not (i) exercise any of his or her remaining Copyright and Related
+Rights in the Work or (ii) assert any associated claims and causes of
+action with respect to the Work, in either case contrary to Affirmer's
+express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+ surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or
+ warranties of any kind concerning the Work, express, implied,
+ statutory or otherwise, including without limitation warranties of
+ title, merchantability, fitness for a particular purpose, non
+ infringement, or the absence of latent or other defects, accuracy, or
+ the present or absence of errors, whether or not discoverable, all to
+ the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons
+ that may apply to the Work or any use thereof, including without
+ limitation any person's Copyright and Related Rights in the Work.
+ Further, Affirmer disclaims responsibility for obtaining any necessary
+ consents, permissions or other rights required for any use of the
+ Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a
+ party to this document and has no duty or obligation with respect to
+ this CC0 or use of the Work.
-<!doctype html>
-<html lang="en">
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
+<!-- 2022-07-13 Wed 04:16 -->
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sixth 3D - 3D engine</title>
-<!-- 2018-06-22 Fri 02:26 -->
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width, initial-scale=1">
-<meta name="generator" content="Org-mode">
-<meta name="author" content="Svjatoslav Agejenko">
-<link href="https://bootswatch.com/4/darkly/bootstrap.min.css" rel="stylesheet">
-<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
-<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>"
-<style type="text/css">
-footer {background-color: #111 !important;}
-pre {background-color: #111; color: #ccc;}
-</style>
-<style type="text/css">
-/* org mode styles on top of twbs */
-
-html {
+<meta name="author" content="Svjatoslav Agejenko" />
+<meta name="generator" content="Org Mode" />
+<style>
+ #content { max-width: 60em; margin: auto; }
+ .title { text-align: center;
+ margin-bottom: .2em; }
+ .subtitle { text-align: center;
+ font-size: medium;
+ font-weight: bold;
+ margin-top:0; }
+ .todo { font-family: monospace; color: red; }
+ .done { font-family: monospace; color: green; }
+ .priority { font-family: monospace; color: orange; }
+ .tag { background-color: #eee; font-family: monospace;
+ padding: 2px; font-size: 80%; font-weight: normal; }
+ .timestamp { color: #bebebe; }
+ .timestamp-kwd { color: #5f9ea0; }
+ .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
+ .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
+ .org-center { margin-left: auto; margin-right: auto; text-align: center; }
+ .underline { text-decoration: underline; }
+ #postamble p, #preamble p { font-size: 90%; margin: .2em; }
+ p.verse { margin-left: 3%; }
+ pre {
+ border: 1px solid #e6e6e6;
+ border-radius: 3px;
+ background-color: #f2f2f2;
+ padding: 8pt;
+ font-family: monospace;
+ overflow: auto;
+ margin: 1.2em;
+ }
+ pre.src {
position: relative;
- min-height: 100%;
-}
-
-body {
- font-size: 18px;
- margin-bottom: 105px;
-}
-
-footer {
+ overflow: auto;
+ }
+ pre.src:before {
+ display: none;
position: absolute;
- bottom: 0;
+ top: -8px;
+ right: 12px;
+ padding: 3px;
+ color: #555;
+ background-color: #f2f2f299;
+ }
+ pre.src:hover:before { display: inline; margin-top: 14px;}
+ /* Languages per Org manual */
+ pre.src-asymptote:before { content: 'Asymptote'; }
+ pre.src-awk:before { content: 'Awk'; }
+ pre.src-authinfo::before { content: 'Authinfo'; }
+ pre.src-C:before { content: 'C'; }
+ /* pre.src-C++ doesn't work in CSS */
+ pre.src-clojure:before { content: 'Clojure'; }
+ pre.src-css:before { content: 'CSS'; }
+ pre.src-D:before { content: 'D'; }
+ pre.src-ditaa:before { content: 'ditaa'; }
+ pre.src-dot:before { content: 'Graphviz'; }
+ pre.src-calc:before { content: 'Emacs Calc'; }
+ pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
+ pre.src-fortran:before { content: 'Fortran'; }
+ pre.src-gnuplot:before { content: 'gnuplot'; }
+ pre.src-haskell:before { content: 'Haskell'; }
+ pre.src-hledger:before { content: 'hledger'; }
+ pre.src-java:before { content: 'Java'; }
+ pre.src-js:before { content: 'Javascript'; }
+ pre.src-latex:before { content: 'LaTeX'; }
+ pre.src-ledger:before { content: 'Ledger'; }
+ pre.src-lisp:before { content: 'Lisp'; }
+ pre.src-lilypond:before { content: 'Lilypond'; }
+ pre.src-lua:before { content: 'Lua'; }
+ pre.src-matlab:before { content: 'MATLAB'; }
+ pre.src-mscgen:before { content: 'Mscgen'; }
+ pre.src-ocaml:before { content: 'Objective Caml'; }
+ pre.src-octave:before { content: 'Octave'; }
+ pre.src-org:before { content: 'Org mode'; }
+ pre.src-oz:before { content: 'OZ'; }
+ pre.src-plantuml:before { content: 'Plantuml'; }
+ pre.src-processing:before { content: 'Processing.js'; }
+ pre.src-python:before { content: 'Python'; }
+ pre.src-R:before { content: 'R'; }
+ pre.src-ruby:before { content: 'Ruby'; }
+ pre.src-sass:before { content: 'Sass'; }
+ pre.src-scheme:before { content: 'Scheme'; }
+ pre.src-screen:before { content: 'Gnu Screen'; }
+ pre.src-sed:before { content: 'Sed'; }
+ pre.src-sh:before { content: 'shell'; }
+ pre.src-sql:before { content: 'SQL'; }
+ pre.src-sqlite:before { content: 'SQLite'; }
+ /* additional languages in org.el's org-babel-load-languages alist */
+ pre.src-forth:before { content: 'Forth'; }
+ pre.src-io:before { content: 'IO'; }
+ pre.src-J:before { content: 'J'; }
+ pre.src-makefile:before { content: 'Makefile'; }
+ pre.src-maxima:before { content: 'Maxima'; }
+ pre.src-perl:before { content: 'Perl'; }
+ pre.src-picolisp:before { content: 'Pico Lisp'; }
+ pre.src-scala:before { content: 'Scala'; }
+ pre.src-shell:before { content: 'Shell Script'; }
+ pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
+ /* additional language identifiers per "defun org-babel-execute"
+ in ob-*.el */
+ pre.src-cpp:before { content: 'C++'; }
+ pre.src-abc:before { content: 'ABC'; }
+ pre.src-coq:before { content: 'Coq'; }
+ pre.src-groovy:before { content: 'Groovy'; }
+ /* additional language identifiers from org-babel-shell-names in
+ ob-shell.el: ob-shell is the only babel language using a lambda to put
+ the execution function name together. */
+ pre.src-bash:before { content: 'bash'; }
+ pre.src-csh:before { content: 'csh'; }
+ pre.src-ash:before { content: 'ash'; }
+ pre.src-dash:before { content: 'dash'; }
+ pre.src-ksh:before { content: 'ksh'; }
+ pre.src-mksh:before { content: 'mksh'; }
+ pre.src-posh:before { content: 'posh'; }
+ /* Additional Emacs modes also supported by the LaTeX listings package */
+ pre.src-ada:before { content: 'Ada'; }
+ pre.src-asm:before { content: 'Assembler'; }
+ pre.src-caml:before { content: 'Caml'; }
+ pre.src-delphi:before { content: 'Delphi'; }
+ pre.src-html:before { content: 'HTML'; }
+ pre.src-idl:before { content: 'IDL'; }
+ pre.src-mercury:before { content: 'Mercury'; }
+ pre.src-metapost:before { content: 'MetaPost'; }
+ pre.src-modula-2:before { content: 'Modula-2'; }
+ pre.src-pascal:before { content: 'Pascal'; }
+ pre.src-ps:before { content: 'PostScript'; }
+ pre.src-prolog:before { content: 'Prolog'; }
+ pre.src-simula:before { content: 'Simula'; }
+ pre.src-tcl:before { content: 'tcl'; }
+ pre.src-tex:before { content: 'TeX'; }
+ pre.src-plain-tex:before { content: 'Plain TeX'; }
+ pre.src-verilog:before { content: 'Verilog'; }
+ pre.src-vhdl:before { content: 'VHDL'; }
+ pre.src-xml:before { content: 'XML'; }
+ pre.src-nxml:before { content: 'XML'; }
+ /* add a generic configuration mode; LaTeX export needs an additional
+ (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
+ pre.src-conf:before { content: 'Configuration File'; }
+
+ table { border-collapse:collapse; }
+ caption.t-above { caption-side: top; }
+ caption.t-bottom { caption-side: bottom; }
+ td, th { vertical-align:top; }
+ th.org-right { text-align: center; }
+ th.org-left { text-align: center; }
+ th.org-center { text-align: center; }
+ td.org-right { text-align: right; }
+ td.org-left { text-align: left; }
+ td.org-center { text-align: center; }
+ dt { font-weight: bold; }
+ .footpara { display: inline; }
+ .footdef { margin-bottom: 1em; }
+ .figure { padding: 1em; }
+ .figure p { text-align: center; }
+ .equation-container {
+ display: table;
+ text-align: center;
width: 100%;
- height: 101px;
- background-color: #f5f5f5;
-}
-
-footer > div {
+ }
+ .equation {
+ vertical-align: middle;
+ }
+ .equation-label {
+ display: table-cell;
+ text-align: right;
+ vertical-align: middle;
+ }
+ .inlinetask {
padding: 10px;
-}
-
-footer p {
- margin: 0 0 5px;
- text-align: center;
- font-size: 16px;
-}
-
-#table-of-contents {
- margin-top: 20px;
- margin-bottom: 20px;
-}
-
-blockquote p {
- font-size: 18px;
-}
-
-pre {
- font-size: 16px;
-}
-
-.footpara {
- display: inline-block;
-}
-
-figcaption {
- font-size: 16px;
- color: #666;
- font-style: italic;
- padding-bottom: 15px;
-}
-
-/* from twbs docs */
-
-.bs-docs-sidebar.affix {
- position: static;
-}
-@media (min-width: 768px) {
- .bs-docs-sidebar {
- padding-left: 20px;
- }
-}
-
-/* All levels of nav */
-.bs-docs-sidebar .nav > li > a {
- display: block;
- padding: 4px 20px;
- font-size: 14px;
- font-weight: 500;
- color: #999;
-}
-.bs-docs-sidebar .nav > li > a:hover,
-.bs-docs-sidebar .nav > li > a:focus {
- padding-left: 19px;
- color: #A1283B;
- text-decoration: none;
- background-color: transparent;
- border-left: 1px solid #A1283B;
-}
-.bs-docs-sidebar .nav > .active > a,
-.bs-docs-sidebar .nav > .active:hover > a,
-.bs-docs-sidebar .nav > .active:focus > a {
- padding-left: 18px;
- font-weight: bold;
- color: #A1283B;
- background-color: transparent;
- border-left: 2px solid #A1283B;
-}
-
-/* Nav: second level (shown on .active) */
-.bs-docs-sidebar .nav .nav {
- display: none; /* Hide by default, but at >768px, show it */
- padding-bottom: 10px;
-}
-.bs-docs-sidebar .nav .nav > li > a {
- padding-top: 1px;
- padding-bottom: 1px;
- padding-left: 30px;
- font-size: 12px;
- font-weight: normal;
-}
-.bs-docs-sidebar .nav .nav > li > a:hover,
-.bs-docs-sidebar .nav .nav > li > a:focus {
- padding-left: 29px;
-}
-.bs-docs-sidebar .nav .nav > .active > a,
-.bs-docs-sidebar .nav .nav > .active:hover > a,
-.bs-docs-sidebar .nav .nav > .active:focus > a {
- padding-left: 28px;
- font-weight: 500;
-}
-
-/* Nav: third level (shown on .active) */
-.bs-docs-sidebar .nav .nav .nav {
- padding-bottom: 10px;
-}
-.bs-docs-sidebar .nav .nav .nav > li > a {
- padding-top: 1px;
- padding-bottom: 1px;
- padding-left: 40px;
- font-size: 12px;
- font-weight: normal;
-}
-.bs-docs-sidebar .nav .nav .nav > li > a:hover,
-.bs-docs-sidebar .nav .nav .nav > li > a:focus {
- padding-left: 39px;
-}
-.bs-docs-sidebar .nav .nav .nav > .active > a,
-.bs-docs-sidebar .nav .nav .nav > .active:hover > a,
-.bs-docs-sidebar .nav .nav .nav > .active:focus > a {
- padding-left: 38px;
- font-weight: 500;
-}
-
-/* Show and affix the side nav when space allows it */
-@media (min-width: 992px) {
- .bs-docs-sidebar .nav > .active > ul {
- display: block;
- }
- /* Widen the fixed sidebar */
- .bs-docs-sidebar.affix,
- .bs-docs-sidebar.affix-bottom {
- width: 213px;
- }
- .bs-docs-sidebar.affix {
- position: fixed; /* Undo the static from mobile first approach */
- top: 20px;
- }
- .bs-docs-sidebar.affix-bottom {
- position: absolute; /* Undo the static from mobile first approach */
- }
- .bs-docs-sidebar.affix .bs-docs-sidenav,.bs-docs-sidebar.affix-bottom .bs-docs-sidenav {
- margin-top: 0;
- margin-bottom: 0
- }
-}
-@media (min-width: 1200px) {
- /* Widen the fixed sidebar again */
- .bs-docs-sidebar.affix-bottom,
- .bs-docs-sidebar.affix {
- width: 263px;
- }
-}
+ border: 2px solid gray;
+ margin: 10px;
+ background: #ffffcc;
+ }
+ #org-div-home-and-up
+ { text-align: right; font-size: 70%; white-space: nowrap; }
+ textarea { overflow-x: auto; }
+ .linenr { font-size: smaller }
+ .code-highlighted { background-color: #ffff00; }
+ .org-info-js_info-navigation { border-style: none; }
+ #org-info-js_console-label
+ { font-size: 10px; font-weight: bold; white-space: nowrap; }
+ .org-info-js_search-highlight
+ { background-color: #ffff00; color: #000000; font-weight: bold; }
+ .org-svg { }
</style>
-<script type="text/javascript">
-$(function() {
- 'use strict';
-
- $('.bs-docs-sidebar li').first().addClass('active');
-
- $(document.body).scrollspy({target: '.bs-docs-sidebar'});
-
- $('.bs-docs-sidebar').affix();
-});
-</script>
+<link href="https://bootswatch.com/3/darkly/bootstrap.min.css" rel="stylesheet">
+<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
+<style type="text/css">
+footer {background-color: #111 !important;}
+pre {background-color: #111; color: #ccc;}
+</style>
+<link rel="stylesheet" type="text/css" href="https://thomasf.github.io/solarized-css/solarized-dark.min.css" />
</head>
<body>
-<div id="content" class="container">
-<div class="row"><div class="col-md-9"><h1 class="title">Sixth 3D - 3D engine</h1>
-<hr >
-<ul class="org-ul">
-<li>This is a subproject of <a href="http://www3.svjatoslav.eu/projects/sixth/">Sixth</a>
+<div id="content" class="content">
+<h1 class="title">Sixth 3D - 3D engine</h1>
+<div id="table-of-contents" role="doc-toc">
+<h2>Table of Contents</h2>
+<div id="text-table-of-contents" role="doc-toc">
+<ul>
+<li><a href="#org7511f90">1. General</a>
+<ul>
+<li><a href="#orge3f1768">1.1. Source code</a></li>
+</ul>
</li>
-
-<li>Clone GIT repository using commanad:
-<pre class="example">
-git clone http://www2.svjatoslav.eu/git/sixth-3d.git
-</pre>
+<li><a href="#orgfea2cd7">2. Project description</a>
+<ul>
+<li><a href="#org4103b1c">2.1. Justification for software rendering</a></li>
+<li><a href="#orgca70003">2.2. Justification for Java</a></li>
+</ul>
</li>
-
-<li><a href="http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=snapshot;h=HEAD;sf=tgz">Download latest snapshot in TAR GZ format</a>
+<li><a href="#org690ab91">3. API documentation</a></li>
+<li><a href="#org228a301">4. Instructions to embed Sixth-3D in your project</a></li>
+<li><a href="#org39d9f00">5. <span class="todo TODO">TODO</span> features to add</a>
+<ul>
+<li><a href="#org16a4a5d">5.1. Render only visible polygons</a></li>
+</ul>
</li>
+</ul>
+</div>
+</div>
-<li>This program is free software: you can redistribute it and/or modify
-it under the terms of the <a href="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a> as
-published by the Free Software Foundation, either version 3 of the
-License, or (at your option) any later version.
-</li>
+<div id="outline-container-org7511f90" class="outline-2">
+<h2 id="org7511f90"><span class="section-number-2">1.</span> General</h2>
+<div class="outline-text-2" id="text-1">
+<ul class="org-ul">
+<li>This program is free software: released under Creative Commons Zero
+(CC0) license</li>
<li>Program author:
<ul class="org-ul">
-<li>Svjatoslav Agejenko
-</li>
-<li>Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>
-</li>
-<li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a>
-</li>
+<li>Svjatoslav Agejenko</li>
+<li>Homepage: <a href="https://svjatoslav.eu">https://svjatoslav.eu</a></li>
+<li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a></li>
+</ul></li>
+
+<li><a href="https://www.svjatoslav.eu/projects/">Other software projects hosted at svjatoslav.eu</a></li>
</ul>
-</li>
+</div>
-<li><a href="http://www.svjatoslav.eu/projects/">Other software projects hosted at svjatoslav.eu</a>
-</li>
+<div id="outline-container-orge3f1768" class="outline-3">
+<h3 id="orge3f1768"><span class="section-number-3">1.1.</span> Source code</h3>
+<div class="outline-text-3" id="text-1-1">
+<ul class="org-ul">
+<li><a href="https://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=snapshot;h=HEAD;sf=tgz">Download latest snapshot in TAR GZ format</a></li>
+
+<li><a href="https://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=summary">Browse Git repository online</a></li>
+
+<li><p>
+Clone Git repository using command:
+</p>
+<pre class="example">
+git clone https://www2.svjatoslav.eu/git/sixth-3d.git
+</pre></li>
+
+<li>See <a href="https://www3.svjatoslav.eu/projects/sixth-3d/apidocs/">JavaDoc</a>.</li>
</ul>
+</div>
+</div>
+</div>
-<div id="outline-container-sec-1" class="outline-2">
-<h2 id="sec-1"><span class="section-number-2">1</span> Project description</h2>
-<div class="outline-text-2" id="text-1">
+<div id="outline-container-orgfea2cd7" class="outline-2">
+<h2 id="orgfea2cd7"><span class="section-number-2">2.</span> Project description</h2>
+<div class="outline-text-2" id="text-2">
<ul class="org-ul">
-<li>See: <a href="http://www3.svjatoslav.eu/projects/sixth-3d-demos/">demos of current 3D engine capabilities</a>
-</li>
+<li>See: <a href="https://www3.svjatoslav.eu/projects/sixth-3d-demos/">demos of current 3D engine capabilities</a></li>
</ul>
<p>
-<a href="#sec-1-1">In software</a>, <a href="#sec-1-2">pure Java</a> realtime 3D rendering engine. With the final
+<a href="#org4103b1c">In software</a>, <a href="#orgca70003">pure Java</a> realtime 3D rendering engine. With the final
goal of becoming a platform for buildng 3D user interfaces and
-interactive data visualization for <a href="http://www3.svjatoslav.eu/projects/sixth/">project Sixth</a>.
+interactive data visualization for <a href="https://www3.svjatoslav.eu/projects/sixth/">project Sixth</a>.
</p>
<p>
-Sixth 3D can be also used as standalone <a href="#sec-3">3D engine in your project</a>.
+Sixth 3D can be also used as standalone <a href="#org228a301">3D engine in your project</a>.
</p>
</div>
-<div id="outline-container-sec-1-1" class="outline-3">
-<h3 id="sec-1-1"><a id="ID-d03013e5-931b-40ca-bc4b-e4b3f23b9a4e" name="ID-d03013e5-931b-40ca-bc4b-e4b3f23b9a4e"></a><span class="section-number-3">1.1</span> Justification for software rendering</h3>
-<div class="outline-text-3" id="text-1-1">
+<div id="outline-container-org4103b1c" class="outline-3">
+<h3 id="org4103b1c"><span class="section-number-3">2.1.</span> Justification for software rendering</h3>
+<div class="outline-text-3" id="text-2-1">
<p>
3D rendering is done in software, 100% pure Java on CPU. At least for
now. Modern CPU cores count keeps growing and therefore rendering by
</p>
</div>
</div>
-<div id="outline-container-sec-1-2" class="outline-3">
-<h3 id="sec-1-2"><a id="ID-a11f7150-1b25-4ca4-a3c3-8c8bd1352bd4" name="ID-a11f7150-1b25-4ca4-a3c3-8c8bd1352bd4"></a><span class="section-number-3">1.2</span> Justification for Java</h3>
-<div class="outline-text-3" id="text-1-2">
+<div id="outline-container-orgca70003" class="outline-3">
+<h3 id="orgca70003"><span class="section-number-3">2.2.</span> Justification for Java</h3>
+<div class="outline-text-3" id="text-2-2">
<ul class="org-ul">
-<li>It is easy to refactor and experiment with.
-</li>
+<li>It is easy to refactor and experiment with.</li>
<li>Easy portability and installation. No need to deal with platform
-specific dependencies.
-</li>
+specific dependencies.</li>
<li>It scales well to handle great complexity.
<ul class="org-ul">
<li>Allows to implement clever performance optimizations (instead of
-going for GPU offered brute-force rendering approach).
-</li>
-</ul>
-</li>
+going for GPU offered brute-force rendering approach).</li>
+</ul></li>
<li>No limitations imposed by:
<ul class="org-ul">
-<li>requirement for decent GPU
-</li>
-<li>GPU missing features
-</li>
-<li>GPU missing/incomplete/buggy drivers
-</li>
-<li>OpenGL specification
-</li>
-</ul>
-</li>
+<li>requirement for decent GPU</li>
+<li>GPU missing features</li>
+<li>GPU missing/incomplete/buggy drivers</li>
+<li>OpenGL specification</li>
+</ul></li>
<li>It is fast enough thanks to:
<ul class="org-ul">
-<li>Java virtual machine just-in-time compiler.
-</li>
-<li>Growing CPU cores count.
-</li>
-</ul>
-</li>
+<li>Java virtual machine just-in-time compiler.</li>
+<li>Growing CPU cores count.</li>
+</ul></li>
<li>As a result it is easy to run on various hardware platforms and
-operating systems.
-</li>
+operating systems.</li>
</ul>
</div>
</div>
</div>
-<div id="outline-container-sec-2" class="outline-2">
-<h2 id="sec-2"><span class="section-number-2">2</span> <span class="label label-primary TODO">TODO</span> API documentation</h2>
-<div class="outline-text-2" id="text-2">
+<div id="outline-container-org690ab91" class="outline-2">
+<h2 id="org690ab91"><span class="section-number-2">3.</span> API documentation</h2>
+<div class="outline-text-2" id="text-3">
+<ul class="org-ul">
+<li>See <a href="https://www3.svjatoslav.eu/projects/sixth-3d/apidocs/">JavaDoc</a>.</li>
+</ul>
+
<p>
-Documentation currently missing for the lack of time.
+Note: due to a lack of time, there is still big room for improvement
+on documentation.
</p>
<p>
So far best resource is to download and explore source code for:
</p>
<ul class="org-ul">
-<li>3D engine (<a href="http://www3.svjatoslav.eu/projects/sixth-3d/graphs/">generated code graphs</a> (generated using <a href="http://www3.svjatoslav.eu/projects/javainspect/">JavaInspect</a>))
-</li>
-<li>For API usage examples, see <a href="http://www3.svjatoslav.eu/projects/sixth-3d-demos/">demos</a>
-</li>
+<li>3D engine (<a href="https://www3.svjatoslav.eu/projects/sixth-3d/graphs/">generated code graphs</a> (generated using <a href="https://www3.svjatoslav.eu/projects/javainspect/">JavaInspect</a>))</li>
+<li>For API usage examples, see <a href="https://www3.svjatoslav.eu/projects/sixth-3d-demos/">demos</a></li>
</ul>
</div>
</div>
-<div id="outline-container-sec-3" class="outline-2">
-<h2 id="sec-3"><a id="ID-08f71987-90af-40dc-bb65-bac87db9e652" name="ID-08f71987-90af-40dc-bb65-bac87db9e652"></a><span class="section-number-2">3</span> Instructions to embed Sixth-3D in your project</h2>
-<div class="outline-text-2" id="text-3">
+<div id="outline-container-org228a301" class="outline-2">
+<h2 id="org228a301"><span class="section-number-2">4.</span> Instructions to embed Sixth-3D in your project</h2>
+<div class="outline-text-2" id="text-4">
<p>
-Maven *pom.xml* file snippet:
+Maven <b>pom.xml</b> file snippet:
</p>
<div class="org-src-container">
-
-<pre class="src src-xml"><dependencies>
+<pre class="src src-xml"><<span style="color: #A6E22E;">dependencies</span>>
...
- <dependency>
- <groupId>eu.svjatoslav</groupId>
- <artifactId>sixth-3d</artifactId>
- <version>1.1</version>
- </dependency>
+ <<span style="color: #A6E22E;">dependency</span>>
+ <<span style="color: #A6E22E;">groupId</span>>eu.svjatoslav</<span style="color: #A6E22E;">groupId</span>>
+ <<span style="color: #A6E22E;">artifactId</span>>sixth-3d</<span style="color: #A6E22E;">artifactId</span>>
+ <<span style="color: #A6E22E;">version</span>>1.2</<span style="color: #A6E22E;">version</span>>
+ </<span style="color: #A6E22E;">dependency</span>>
...
-</dependencies>
+</<span style="color: #A6E22E;">dependencies</span>>
-<repositories>
+<<span style="color: #A6E22E;">repositories</span>>
...
- <repository>
- <id>svjatoslav.eu</id>
- <name>Svjatoslav repository</name>
- <url>http://www2.svjatoslav.eu/maven/</url>
- </repository>
+ <<span style="color: #A6E22E;">repository</span>>
+ <<span style="color: #A6E22E;">id</span>>svjatoslav.eu</<span style="color: #A6E22E;">id</span>>
+ <<span style="color: #A6E22E;">name</span>>Svjatoslav repository</<span style="color: #A6E22E;">name</span>>
+ <<span style="color: #A6E22E;">url</span>>http://www3.svjatoslav.eu/maven/</<span style="color: #A6E22E;">url</span>>
+ </<span style="color: #A6E22E;">repository</span>>
...
-</repositories>
+</<span style="color: #A6E22E;">repositories</span>>
</pre>
</div>
<p>
-For API usage examples, see <a href="http://www3.svjatoslav.eu/projects/sixth-3d-demos/">demos</a>.
+For API usage examples, see <a href="https://www3.svjatoslav.eu/projects/sixth-3d-demos/">demos</a>.
</p>
</div>
</div>
-<div id="outline-container-sec-4" class="outline-2">
-<h2 id="sec-4"><span class="section-number-2">4</span> <span class="label label-primary TODO">TODO</span> features to add</h2>
-<div class="outline-text-2" id="text-4">
+<div id="outline-container-org39d9f00" class="outline-2">
+<h2 id="org39d9f00"><span class="section-number-2">5.</span> <span class="todo TODO">TODO</span> features to add</h2>
+<div class="outline-text-2" id="text-5">
<ul class="org-ul">
+<li>read this as example, and apply improvements/fixes where applicable:
+<a href="http://blog.rogach.org/2015/08/how-to-create-your-own-simple-3d-render.html">http://blog.rogach.org/2015/08/how-to-create-your-own-simple-3d-render.html</a></li>
+
+<li>Improve triangulation. Read: <a href="https://ianthehenry.com/posts/delaunay/">https://ianthehenry.com/posts/delaunay/</a></li>
+
<li>Partial region/frame repaint: when only one small object changed on
-the scene, it would be faster to re-render that specific area.
-</li>
+the scene, it would be faster to re-render that specific area.</li>
<li>Once partial rendering works, in would be easy to add multi-core
rendering support. So that each core renders it's own region of the
-screen.
-</li>
+screen.</li>
<li>Antialiazing. Would improve text readability. If antialiazing is too
expensive for every frame, it could be used only for last frame
-before animations become still and waiting for user input starts.
-</li>
-
-<li>Render only visible polygons.
+before animations become still and waiting for user input starts.</li>
+</ul>
+</div>
+<div id="outline-container-org16a4a5d" class="outline-3">
+<h3 id="org16a4a5d"><span class="section-number-3">5.1.</span> Render only visible polygons</h3>
+<div class="outline-text-3" id="text-5-1">
<ul class="org-ul">
-<li>This would significantly reduce RAM <-> CPU traffic.
-</li>
+<li>This would significantly reduce RAM <-> CPU traffic.</li>
<li>General algorithm description:
<ul class="org-ul">
<li>For each horizontal scanline:
<ul class="org-ul">
-<li>sort polygon edges from left to right
-</li>
+<li>sort polygon edges from left to right</li>
<li>while iterating and drawing pixels over screen X axis (left to
right) track next appearing/disappearing polygons.
<ul class="org-ul">
-<li>For each polygon edge update Z sorted active polygons list.
-</li>
+<li>For each polygon edge update Z sorted active polygons list.</li>
<li>Only draw pixel from the top-most polygon.
<ul class="org-ul">
<li>Only if polygon area is transparent/half-transparent add
-colors from the polygons below.
-</li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-</li>
+colors from the polygons below.</li>
+</ul></li>
+</ul></li>
+</ul></li>
+</ul></li>
<li>As a bonus, this would allow to track which polygons are really
visible in the final scene for each frame.
<li>Dynamic geometry simplification:
<ul class="org-ul">
<li>Dynamically detect and replace invisible objects from the
-scene with simplified bounding box.
-</li>
+scene with simplified bounding box.</li>
<li>Dynamically replace boudnig box with actual object once it
-becomes visible.
-</li>
-</ul>
-</li>
+becomes visible.</li>
+</ul></li>
-<li>Dynamically unload unused textures from RAM.
-</li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-</li>
+<li>Dynamically unload unused textures from RAM.</li>
+</ul></li>
+</ul></li>
</ul>
</div>
</div>
-</div><div class="col-md-3"><nav id="table-of-contents">
-<div id="text-table-of-contents" class="bs-docs-sidebar">
-<ul class="nav">
-<li><a href="#sec-1">1. Project description</a>
-<ul class="nav">
-<li><a href="#sec-1-1">1.1. Justification for software rendering</a></li>
-<li><a href="#sec-1-2">1.2. Justification for Java</a></li>
-</ul>
-</li>
-<li><a href="#sec-2">2. API documentation</a></li>
-<li><a href="#sec-3">3. Instructions to embed Sixth-3D in your project</a></li>
-<li><a href="#sec-4">4. features to add</a></li>
-</ul>
</div>
-</nav>
-</div></div></div>
-<footer id="postamble" class="">
-<div><p class="author">Author: Svjatoslav Agejenko</p>
-<p class="date">Created: 2018-06-22 Fri 02:26</p>
-<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.1.1 (<a href="http://orgmode.org">Org-mode</a> 8.2.10)</p>
</div>
-</footer>
+<div id="postamble" class="status">
+<p class="author">Author: Svjatoslav Agejenko</p>
+<p class="date">Created: 2022-07-13 Wed 04:16</p>
+<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
+</div>
</body>
</html>
#+TITLE: Sixth 3D - 3D engine
------
-- This is a subproject of [[http://www3.svjatoslav.eu/projects/sixth/][Sixth]]
-
-- Clone GIT repository using command:
- : git clone http://www2.svjatoslav.eu/git/sixth-3d.git
-
-- [[http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=snapshot;h=HEAD;sf=tgz][Download latest snapshot in TAR GZ format]]
+* (document settings) :noexport:
+** use dark style for TWBS-HTML exporter
+#+HTML_HEAD: <link href="https://bootswatch.com/3/darkly/bootstrap.min.css" rel="stylesheet">
+#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
+#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
+#+HTML_HEAD: <style type="text/css">
+#+HTML_HEAD: footer {background-color: #111 !important;}
+#+HTML_HEAD: pre {background-color: #111; color: #ccc;}
+#+HTML_HEAD: </style>
-+ This program is free software: you can redistribute it and/or modify
- it under the terms of the [[https://www.gnu.org/licenses/lgpl.html][GNU Lesser General Public License]] as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
+* General
+- This program is free software: released under Creative Commons Zero
+ (CC0) license
- Program author:
- Svjatoslav Agejenko
- - Homepage: http://svjatoslav.eu
+ - Homepage: https://svjatoslav.eu
- Email: mailto://svjatoslav@svjatoslav.eu
-- [[http://www.svjatoslav.eu/projects/][Other software projects hosted at svjatoslav.eu]]
+- [[https://www.svjatoslav.eu/projects/][Other software projects hosted at svjatoslav.eu]]
-* (document settings) :noexport:
-** use dark style for TWBS-HTML exporter
-#+HTML_HEAD: <link href="https://bootswatch.com/4/darkly/bootstrap.min.css" rel="stylesheet">
-#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
-#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>"
-#+HTML_HEAD: <style type="text/css">
-#+HTML_HEAD: footer {background-color: #111 !important;}
-#+HTML_HEAD: pre {background-color: #111; color: #ccc;}
-#+HTML_HEAD: </style>
+** Source code
+- [[https://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=snapshot;h=HEAD;sf=tgz][Download latest snapshot in TAR GZ format]]
+
+- [[https://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=summary][Browse Git repository online]]
+
+- Clone Git repository using command:
+ : git clone https://www2.svjatoslav.eu/git/sixth-3d.git
+
+- See [[https://www3.svjatoslav.eu/projects/sixth-3d/apidocs/][JavaDoc]].
* Project description
-+ See: [[http://www3.svjatoslav.eu/projects/sixth-3d-demos/][demos of current 3D engine capabilities]]
++ See: [[https://www3.svjatoslav.eu/projects/sixth-3d-demos/][demos of current 3D engine capabilities]]
[[id:d03013e5-931b-40ca-bc4b-e4b3f23b9a4e][In software]], [[id:a11f7150-1b25-4ca4-a3c3-8c8bd1352bd4][pure Java]] realtime 3D rendering engine. With the final
goal of becoming a platform for buildng 3D user interfaces and
-interactive data visualization for [[http://www3.svjatoslav.eu/projects/sixth/][project Sixth]].
+interactive data visualization for [[https://www3.svjatoslav.eu/projects/sixth/][project Sixth]].
Sixth 3D can be also used as standalone [[id:08f71987-90af-40dc-bb65-bac87db9e652][3D engine in your project]].
- As a result it is easy to run on various hardware platforms and
operating systems.
-* TODO API documentation
-Documentation currently missing for the lack of time.
+* API documentation
+- See [[https://www3.svjatoslav.eu/projects/sixth-3d/apidocs/][JavaDoc]].
+
+Note: due to a lack of time, there is still big room for improvement
+on documentation.
So far best resource is to download and explore source code for:
-+ 3D engine ([[http://www3.svjatoslav.eu/projects/sixth-3d/graphs/][generated code graphs]] (generated using [[http://www3.svjatoslav.eu/projects/javainspect/][JavaInspect]]))
-+ For API usage examples, see [[http://www3.svjatoslav.eu/projects/sixth-3d-demos/][demos]]
++ 3D engine ([[https://www3.svjatoslav.eu/projects/sixth-3d/graphs/][generated code graphs]] (generated using [[https://www3.svjatoslav.eu/projects/javainspect/][JavaInspect]]))
++ For API usage examples, see [[https://www3.svjatoslav.eu/projects/sixth-3d-demos/][demos]]
* Instructions to embed Sixth-3D in your project
:PROPERTIES:
:ID: 08f71987-90af-40dc-bb65-bac87db9e652
<dependency>
<groupId>eu.svjatoslav</groupId>
<artifactId>sixth-3d</artifactId>
- <version>1.1</version>
+ <version>1.2</version>
</dependency>
...
</dependencies>
<repository>
<id>svjatoslav.eu</id>
<name>Svjatoslav repository</name>
- <url>http://www2.svjatoslav.eu/maven/</url>
+ <url>http://www3.svjatoslav.eu/maven/</url>
</repository>
...
</repositories>
#+END_SRC
-For API usage examples, see [[http://www3.svjatoslav.eu/projects/sixth-3d-demos/][demos]].
+For API usage examples, see [[https://www3.svjatoslav.eu/projects/sixth-3d-demos/][demos]].
* TODO features to add
++ read this as example, and apply improvements/fixes where applicable:
+ http://blog.rogach.org/2015/08/how-to-create-your-own-simple-3d-render.html
+
++ Improve triangulation. Read: https://ianthehenry.com/posts/delaunay/
+
+ Partial region/frame repaint: when only one small object changed on
the scene, it would be faster to re-render that specific area.
+ Antialiazing. Would improve text readability. If antialiazing is too
expensive for every frame, it could be used only for last frame
before animations become still and waiting for user input starts.
+** Render only visible polygons
++ This would significantly reduce RAM <-> CPU traffic.
-+ Render only visible polygons.
- + This would significantly reduce RAM <-> CPU traffic.
-
- + General algorithm description:
- + For each horizontal scanline:
- + sort polygon edges from left to right
- + while iterating and drawing pixels over screen X axis (left to
- right) track next appearing/disappearing polygons.
- + For each polygon edge update Z sorted active polygons list.
- + Only draw pixel from the top-most polygon.
- + Only if polygon area is transparent/half-transparent add
- colors from the polygons below.
++ General algorithm description:
+ + For each horizontal scanline:
+ + sort polygon edges from left to right
+ + while iterating and drawing pixels over screen X axis (left to
+ right) track next appearing/disappearing polygons.
+ + For each polygon edge update Z sorted active polygons list.
+ + Only draw pixel from the top-most polygon.
+ + Only if polygon area is transparent/half-transparent add
+ colors from the polygons below.
- + As a bonus, this would allow to track which polygons are really
- visible in the final scene for each frame.
++ As a bonus, this would allow to track which polygons are really
+ visible in the final scene for each frame.
- + Such information allows further optimizations:
+ + Such information allows further optimizations:
- + Dynamic geometry simplification:
- + Dynamically detect and replace invisible objects from the
- scene with simplified bounding box.
+ + Dynamic geometry simplification:
+ + Dynamically detect and replace invisible objects from the
+ scene with simplified bounding box.
- + Dynamically replace boudnig box with actual object once it
- becomes visible.
+ + Dynamically replace boudnig box with actual object once it
+ becomes visible.
- + Dynamically unload unused textures from RAM.
+ + Dynamically unload unused textures from RAM.
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eu.svjatoslav</groupId>
<artifactId>sixth-3d</artifactId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
<name>Sixth 3D</name>
<description>3D engine</description>
<properties>
+ <java.version>1.8</java.version>
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<organization>
<name>svjatoslav.eu</name>
- <url>http://svjatoslav.eu</url>
+ <url>https://svjatoslav.eu</url>
</organization>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.8.1</version>
+ <version>4.12</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>eu.svjatoslav</groupId>
- <artifactId>javainspect</artifactId>
- <version>1.5</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
+ <version>3.8.1</version>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
+ <source>8</source>
+ <target>8</target>
<optimize>true</optimize>
<encoding>UTF-8</encoding>
</configuration>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.9</version>
+ <version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
</goals>
</execution>
</executions>
+ <configuration>
+ <!-- workaround for https://bugs.openjdk.java.net/browse/JDK-8212233 -->
+ <javaApiLinks>
+ <property>
+ <name>foo</name>
+ <value>bar</value>
+ </property>
+ </javaApiLinks>
+ <!-- Workaround for https://stackoverflow.com/questions/49472783/maven-is-unable-to-find-javadoc-command -->
+ <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
+ </configuration>
</plugin>
<plugin>
<snapshotRepository>
<id>svjatoslav.eu</id>
<name>svjatoslav.eu</name>
- <url>scpexe://svjatoslav.eu/var/www/svjatoslav.eu/maven</url>
+ <url>scpexe://svjatoslav.eu:10006/srv/maven</url>
</snapshotRepository>
<repository>
<id>svjatoslav.eu</id>
<name>svjatoslav.eu</name>
- <url>scpexe://svjatoslav.eu/var/www/svjatoslav.eu/maven</url>
+ <url>scpexe://svjatoslav.eu:10006/srv/maven</url>
</repository>
</distributionManagement>
<repository>
<id>svjatoslav.eu</id>
<name>Svjatoslav repository</name>
- <url>http://www2.svjatoslav.eu/maven/</url>
+ <url>https://www3.svjatoslav.eu/maven/</url>
</repository>
</repositories>
<scm>
- <connection>scm:git:ssh://git@svjatoslav.eu/home/git/repositories/sixth-3d.git</connection>
- <developerConnection>scm:git:ssh://git@svjatoslav.eu/home/git/repositories/sixth-3d.git</developerConnection>
+ <connection>scm:git:ssh://n0@svjatoslav.eu:10006/home/n0/git/sixth-3d.git</connection>
+ <developerConnection>scm:git:ssh://n0@svjatoslav.eu:10006/home/n0/git/sixth-3d.git</developerConnection>
<tag>HEAD</tag>
</scm>
-</project>
\ No newline at end of file
+</project>
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.geometry;
/**
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.geometry;
public class Circle {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.geometry;
import static java.lang.Math.sqrt;
this.y = y;
}
- public Point2D(final Point2D source) {
- x = source.x;
- y = source.y;
+ public Point2D(final Point2D parent) {
+ x = parent.x;
+ y = parent.y;
}
- public Point2D add(final Point2D direction) {
- x += direction.x;
- y += direction.y;
+ /**
+ * Add other point to current point.
+ *
+ * @return current point.
+ */
+ public Point2D add(final Point2D otherPoint) {
+ x += otherPoint.x;
+ y += otherPoint.y;
return this;
}
return new Point2D(this);
}
- public void clone(final Point2D source) {
- x = source.x;
- y = source.y;
+ public void clone(final Point2D parent) {
+ x = parent.x;
+ y = parent.y;
}
public Point2D getMiddle(final Point2D p1, final Point2D p2) {
y = (int) y;
}
- public Point2D subtract(final Point2D point) {
- x -= point.x;
- y -= point.y;
+ /**
+ * Subtract other point from current point.
+ *
+ * @return current point.
+ */
+ public Point2D subtract(final Point2D otherPoint) {
+ x -= otherPoint.x;
+ y -= otherPoint.y;
return this;
}
return this;
}
+ @Override
+ public String toString() {
+ return "Point2D{" +
+ "x=" + x +
+ ", y=" + y +
+ '}';
+ }
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.geometry;
import static java.lang.Math.*;
* Used to represent point in a 3D space or vector.
*/
-public class Point3D extends Point2D implements Cloneable {
+public class Point3D implements Cloneable {
- public double z;
+ public double x, y, z;
public Point3D() {
}
this.z = z;
}
- public Point3D(final Point3D parentPoint) {
- x = parentPoint.x;
- y = parentPoint.y;
- z = parentPoint.z;
+ /**
+ * Creates new current point by cloning coordinates from parent point.
+ */
+ public Point3D(final Point3D parent) {
+ x = parent.x;
+ y = parent.y;
+ z = parent.z;
}
- public Point3D add(final Point3D direction) {
- super.add(direction);
- z += direction.z;
+ /**
+ * Add other point to current point.
+ *
+ * @return current point.
+ */
+ public Point3D add(final Point3D otherPoint) {
+ x += otherPoint.x;
+ y += otherPoint.y;
+ z += otherPoint.z;
return this;
}
- @Override
public Point3D clone() {
return new Point3D(this);
}
- public Point3D clone(final Point3D source) {
- x = source.x;
- y = source.y;
- z = source.z;
+ public Point3D clone(final Point3D parent) {
+ x = parent.x;
+ y = parent.y;
+ z = parent.z;
return this;
}
return this;
}
- @Override
public boolean isZero() {
return (x == 0) && (y == 0) && (z == 0);
}
return Math.atan2(y - anotherPoint.y, z - anotherPoint.z);
}
+ public double getAngleXY(final Point3D anotherPoint) {
+ return Math.atan2(x - anotherPoint.x, y - anotherPoint.y);
+ }
+
/**
* Compute distance to another point.
*/
return sqrt(((xDelta * xDelta) + (yDelta * yDelta) + (zDelta * zDelta)));
}
- @Override
public double getVectorLength() {
return sqrt(((x * x) + (y * y) + (z * z)));
}
- @Override
public Point3D invert() {
x = -x;
y = -y;
z = z2 + center.z;
}
- @Override
public void roundToInteger() {
x = (int) x;
y = (int) y;
this.z = z;
}
- public Point3D subtract(final Point3D direction) {
- super.subtract(direction);
- z -= direction.z;
+ /**
+ * Subtract other point from current point.
+ *
+ * @return current point.
+ */
+ public Point3D subtract(final Point3D otherPoint) {
+ x -= otherPoint.x;
+ y -= otherPoint.y;
+ z -= otherPoint.z;
return this;
}
return "x:" + x + " y:" + y + " z:" + z;
}
+ /**
+ * @return current point.
+ */
public Point3D translateX(final double xIncrement) {
x += xIncrement;
return this;
}
+ /**
+ * @return current point.
+ */
public Point3D translateY(final double yIncrement) {
y += yIncrement;
return this;
}
+ /**
+ * @return current point.
+ */
public Point3D translateZ(final double zIncrement) {
z += zIncrement;
return this;
}
+ /**
+ * Here we assume that Z coordinate is distance to the viewer.
+ * If Z is positive, then point is in front of the viewer, and therefore it is visible.
+ *
+ * @return point visibility status.
+ */
public boolean isVisible() {
-
- if (z > 0)
- return true;
-
- // if ((z > 0) && (x > -1000) && (y > -1000) && (x < 2000) && (y <
- // 2000))
- // return true;
-
- return false;
+ return z > 0;
}
- @Override
+ /**
+ * Resets point to 0 coordinate in X, Y and Z axis.
+ *
+ * @return current point.
+ */
public Point3D zero() {
- super.zero();
+ x = 0;
+ y = 0;
z = 0;
return this;
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.geometry;
public class Polygon {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
-
package eu.svjatoslav.sixth.e3d.geometry;
public class Rectangle {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui;
import eu.svjatoslav.sixth.e3d.geometry.Box;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
-import eu.svjatoslav.sixth.e3d.gui.humaninput.UserInputHandler;
-import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.KeyboardHelper;
+import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardInputHandler;
+import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardHelper;
import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape;
import java.awt.event.KeyEvent;
public class GuiComponent extends AbstractCompositeShape implements
- UserInputHandler, MouseInteractionController {
+ KeyboardInputHandler, MouseInteractionController {
private static final String GROUP_GUI_FOCUS = "gui.focus";
public final ViewPanel viewPanel;
setDimensions(size);
}
- @Override
- public boolean beforeRender(final ViewPanel viewPanel,
- final int millisecondsSinceLastFrame) {
- return false;
- }
-
private WireframeBox createBorder() {
final LineAppearance appearance = new LineAppearance(10,
new eu.svjatoslav.sixth.e3d.renderer.raster.Color(255, 0, 0, 100));
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui;
import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseEvent;
public int frameNumber = 0;
/**
- * Mouse click. During rendering we can detect which item user clicked on.
+ * UI component that mouse is currently hovering over.
*/
- public MouseEvent mouseEvent;
+ private MouseInteractionController currentMouseOverComponent;
+
+ public void prepareForNewFrameRendering(){
+ mouseEvent = null;
+ objectUnderMouse = null;
+ }
+
+ /**
+ * Mouse click event that needs to be processed.
+ */
+ private MouseEvent mouseEvent;
+
+ public void setMouseEvent(MouseEvent mouseEvent) {
+ this.mouseEvent = mouseEvent;
+ }
+
+ public MouseEvent getMouseEvent() {
+ return mouseEvent;
+ }
/**
* Item that user clicked on.
*/
- public MouseInteractionController objectUnderMouse;
+ private MouseInteractionController objectUnderMouse;
+
+ /**
+ * Called when given object was detected under mouse cursor, while processing {@link #mouseEvent}.
+ * Because objects are rendered back to front. The last method caller will set the top-most object, if
+ * there are multiple objects under mouse cursor.
+ */
+ public void setObjectUnderMouse(MouseInteractionController objectUnderMouse) {
+ this.objectUnderMouse = objectUnderMouse;
+ }
public RenderingContext(final int width, final int height) {
this.width = width;
graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}
+ /**
+ * @return <code>true</code> if view repaint is needed.
+ */
+ public boolean handleDetectedComponentMouseEvents() {
+ if (objectUnderMouse != null) {
+ if (mouseEvent.button == 0) {
+ // mouse over
+ if (currentMouseOverComponent == null) {
+ currentMouseOverComponent = objectUnderMouse;
+ return currentMouseOverComponent.mouseEntered();
+ } else if (currentMouseOverComponent != objectUnderMouse) {
+ boolean viewRepaintNeeded = currentMouseOverComponent.mouseExited();
+ currentMouseOverComponent = objectUnderMouse;
+ return viewRepaintNeeded | currentMouseOverComponent.mouseEntered();
+ }
+ } else {
+ // mouse click
+ return objectUnderMouse.mouseClicked();
+ }
+ } else if (currentMouseOverComponent != null) {
+ boolean viewRepaintNeeded = currentMouseOverComponent.mouseExited();
+ currentMouseOverComponent = null;
+ return viewRepaintNeeded;
+ }
+ return false;
+ }
+
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui;
public class TextPointer implements Comparable<TextPointer> {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
-
package eu.svjatoslav.sixth.e3d.gui;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui;
import javax.swing.*;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui;
import eu.svjatoslav.sixth.e3d.gui.humaninput.HIDInputTracker;
import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardFocusStack;
-import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
import javax.swing.*;
private Timer canvasUpdateTimer;
private ViewUpdateTimerTask canvasUpdateTimerTask;
private RenderingContext renderingContext = null;
+
/**
- * UI component that mouse is currently hovering over.
- */
- private MouseInteractionController currentMouseOverComponent;
- /**
- * Currently target FPS for this view. It can be changed at runtime. Also when nothing
- * changes in the view, then frames are not really repainted.
+ * Currently target frames per second rate for this view. Target FPS can be changed at runtime.
+ * 3D engine tries to be smart and only repaints screen when there are visible changes.
*/
- private int targetFPS = 30;
+ private int targetFPS = 60;
+
/**
* Set to true if it is known than next frame reeds to be painted. Flag is cleared
* immediately after frame got updated.
*/
private boolean viewRepaintNeeded = true;
+
public ViewPanel() {
viewRenderListeners.add(avatar);
viewRenderListeners.add(HIDInputTracker);
return renderingContext;
}
- private void handleDetectedComponentMouseEvents() {
- if (renderingContext.objectUnderMouse != null) {
- if (renderingContext.mouseEvent.button == 0) {
- // mouse over
- if (currentMouseOverComponent == null) {
- currentMouseOverComponent = renderingContext.objectUnderMouse;
- viewRepaintNeeded |= currentMouseOverComponent.mouseEntered();
- } else if (currentMouseOverComponent != renderingContext.objectUnderMouse) {
- viewRepaintNeeded |= currentMouseOverComponent.mouseExited();
- currentMouseOverComponent = renderingContext.objectUnderMouse;
- viewRepaintNeeded |= currentMouseOverComponent.mouseEntered();
- }
- } else {
- // mouse click
- viewRepaintNeeded |= renderingContext.objectUnderMouse.mouseClicked();
- }
- } else if (currentMouseOverComponent != null) {
- viewRepaintNeeded |= currentMouseOverComponent.mouseExited();
- currentMouseOverComponent = null;
- }
- }
-
private void initializePanelLayout() {
setFocusCycleRoot(true);
setOpaque(true);
}
private void renderFrame() {
-
// paint root geometry collection to the offscreen render buffer
clearCanvas();
rootShapeCollection.paint(this, renderingContext);
// abort rendering if window size is invalid
if ((getWidth() > 0) && (getHeight() > 0) && renderFrame) {
renderFrame();
- handleDetectedComponentMouseEvents();
+ viewRepaintNeeded = renderingContext.handleDetectedComponentMouseEvents();
}
}
renderingContext = new RenderingContext(panelWidth, panelHeight);
}
- renderingContext.mouseEvent = null;
- renderingContext.objectUnderMouse = null;
+ renderingContext.prepareForNewFrameRendering();
}
private boolean notifyViewRenderListeners(int millisecondsPassedSinceLastUpdate) {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui;
public interface ViewRenderListener {
/**
- * Notifies that it is about time to render next frame and
+ * Notifies that it is about time (to keep constant framerate) to render next frame and
* allows listener to do any related processing that it needs to.
* <p>
* Each {@link ViewRenderListener} will be notified exactly once before every frame is rendered.
* <p>
* {@link ViewRenderListener} can determine if frame repaint is actually
* needed from its perspective. Frame will be rendered only if at least one listener says yes.
+ * This mechanism allows to save computing power and energy by skipping frame rendering when possible.
*
* @return <code>true</code> if underlying view shall be re-rendered. If at least one of the view update listeners
* returns <code>true</code>, view is re-rendered.
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui;
public class ViewUpdateTimerTask extends java.util.TimerTask {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui.humaninput;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
import java.util.List;
import java.util.Map;
+/**
+ * Human input device input tracker.
+ * <p>
+ * Idea is to capture all keyboard and mouse inputs from underlying operating system in this class
+ * and forward those as needed to subsequent virtual components.
+ */
public class HIDInputTracker implements
MouseMotionListener, KeyListener, MouseListener, MouseWheelListener, ViewRenderListener {
* @return <code>true</code> if view needs to be repainted.
*/
private boolean handleKeyboardEvents() {
- final UserInputHandler currentFocusOwner = viewPanel.getKeyboardFocusStack().getCurrentFocusOwner();
+ final KeyboardInputHandler currentFocusOwner = viewPanel.getKeyboardFocusStack().getCurrentFocusOwner();
ArrayList<KeyEvent> unprocessedKeyboardEvents = getUnprocessedKeyboardEvents();
return currentFocusOwner != null
* @return <code>true</code> if view update is needed.
*/
private boolean forwardKeyboardEventsToFocusOwner(
- UserInputHandler currentFocusOwner, ArrayList<KeyEvent> keyEvents) {
+ KeyboardInputHandler currentFocusOwner, ArrayList<KeyEvent> keyEvents) {
boolean viewUpdateNeeded = false;
for (KeyEvent keyEvent : keyEvents)
return viewUpdateNeeded;
}
- private boolean processKeyEvent(UserInputHandler currentFocusOwner, KeyEvent keyEvent) {
+ private boolean processKeyEvent(KeyboardInputHandler currentFocusOwner, KeyEvent keyEvent) {
switch (keyEvent.getID()) {
case KeyEvent.KEY_PRESSED:
return currentFocusOwner.keyPressed(keyEvent, viewPanel);
* @return <code>true</code> if view needs to be repainted.
*/
private synchronized boolean handleMouseClicksAndHover(final ViewPanel viewPanel) {
- MouseEvent mouseEventAndLocationToTrace = getMouseEventAndLocationToTrace(viewPanel);
- if (mouseEventAndLocationToTrace != null)
- {
- viewPanel.getRenderingContext().mouseEvent = mouseEventAndLocationToTrace;
- return true;
+ boolean rerenderNeeded = false;
+ MouseEvent event = findClickLocationToTrace();
+ if (event != null) {
+ // process mouse clicks as a first priority
+ rerenderNeeded = true;
+ } else {
+ // when there are no mouse clicks, process mouse hovering
+
+ if (mouseMoved) {
+ mouseMoved = false;
+ // we would like to re-render frame when user moved mouse, to see what objects mouse is hovering over
+ rerenderNeeded = true;
+ }
+
+ if (currentMouseLocation != null) {
+ // mouse click with button 0 amounts to mouse hovering event
+ event = new MouseEvent(currentMouseLocation, 0);
+ }
}
- return false;
- }
- private MouseEvent getMouseEventAndLocationToTrace(ViewPanel viewPanel) {
- MouseEvent unprocessedMouseEvent = findClickLocationToTrace();
- if (unprocessedMouseEvent != null) {
- return unprocessedMouseEvent;
- } else
- return getHoverLocationToTrace(viewPanel);
+ if (viewPanel.getRenderingContext() != null)
+ viewPanel.getRenderingContext().setMouseEvent(event);
+
+ return rerenderNeeded;
}
private MouseEvent findClickLocationToTrace() {
}
}
- private MouseEvent getHoverLocationToTrace(ViewPanel viewPanel) {
- if (mouseMoved) {
- mouseMoved = false;
- if (currentMouseLocation != null) {
- return new MouseEvent(currentMouseLocation, 0);
- // mouse click with button 0 amounts to mouse hovering event
- }
- }
- return null;
- }
-
boolean isKeyPressed(final int keyCode) {
return pressedKeysToPressedTimeMap.containsKey(keyCode);
}
* @return <code>true</code> if view needs to be repainted.
*/
private boolean handleMouseDragging() {
- // TODO: need to detect whether user moved mouse or touch screen
+ // TODO: It would be nice here to detect somehow whether user moved mouse or touch screen.
+ // in case of touch screen, we would like to reverse movement along X and Y axis.
final Avatar avatar = viewPanel.getAvatar();
// for mouse
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui.humaninput;
import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
private final ViewPanel viewPanel;
private WorldNavigationUserInputTracker defaultInputHandler = new WorldNavigationUserInputTracker();
- private Stack<UserInputHandler> inputHandlers = new Stack<>();
- private UserInputHandler currentUserInputHandler;
+ private Stack<KeyboardInputHandler> inputHandlers = new Stack<>();
+ private KeyboardInputHandler currentUserInputHandler;
public KeyboardFocusStack(final ViewPanel viewPanel) {
this.viewPanel = viewPanel;
pushFocusOwner(defaultInputHandler);
}
- public UserInputHandler getCurrentFocusOwner() {
+ public KeyboardInputHandler getCurrentFocusOwner() {
return currentUserInputHandler;
}
currentUserInputHandler.focusReceived(viewPanel);
}
- public boolean pushFocusOwner(final UserInputHandler newInputHandler) {
+ public boolean pushFocusOwner(final KeyboardInputHandler newInputHandler) {
boolean updateNeeded = false;
if (currentUserInputHandler == newInputHandler)
--- /dev/null
+/*
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
+ */
+package eu.svjatoslav.sixth.e3d.gui.humaninput;
+
+import java.awt.event.InputEvent;
+import java.util.HashSet;
+import java.util.Set;
+
+public class KeyboardHelper {
+
+ public static final int TAB = 9;
+ public static final int DOWN = 40;
+ public static final int UP = 38;
+ public static final int RIGHT = 39;
+ public static final int LEFT = 37;
+ public static final int PGDOWN = 34;
+ public static final int PGUP = 33;
+ public static final int HOME = 36;
+ public static final int END = 35;
+ public static final int DEL = 127;
+ public static final int ENTER = 10;
+ public static final int BACKSPACE = 8;
+ public static final int ESC = 27;
+ public static final int SHIFT = 16;
+
+ private static final Set<Integer> nonText;
+
+ static {
+ nonText = new HashSet<>();
+ nonText.add(DOWN);
+ nonText.add(UP);
+ nonText.add(LEFT);
+ nonText.add(RIGHT);
+
+ nonText.add(SHIFT);
+ nonText.add(ESC);
+ }
+
+ public static boolean isAltPressed(final int modifiersEx) {
+ return (modifiersEx | InputEvent.ALT_DOWN_MASK) == modifiersEx;
+ }
+
+ public static boolean isCtrlPressed(final int modifiersEx) {
+ return (modifiersEx | InputEvent.CTRL_DOWN_MASK) == modifiersEx;
+ }
+
+ public static boolean isShiftPressed(final int modifiersEx) {
+ return (modifiersEx | InputEvent.SHIFT_DOWN_MASK) == modifiersEx;
+ }
+
+ public static boolean isText(final int keyCode) {
+ return !nonText.contains(keyCode);
+ }
+
+}
--- /dev/null
+/*
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
+ */
+package eu.svjatoslav.sixth.e3d.gui.humaninput;
+
+import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
+
+import java.awt.event.KeyEvent;
+
+/**
+ * This is the process:
+ *
+ * 1. Component receives focus, perhaps because user clicked on it with the mouse.
+ * 2. Now component will receive user key press and release events from the keyboard.
+ * 3. Component loses focus. Perhaps user chose another component to interact with.
+ */
+public interface KeyboardInputHandler {
+
+ /**
+ * @return <code>true</code> if view needs to be re-rendered.
+ */
+ boolean focusLost(ViewPanel viewPanel);
+
+ /**
+ * @return <code>true</code> if view needs to be re-rendered.
+ */
+ boolean focusReceived(ViewPanel viewPanel);
+
+ /**
+ * @return <code>true</code> if view needs to be re-rendered.
+ */
+ boolean keyPressed(KeyEvent event, ViewPanel viewPanel);
+
+ /**
+ * @return <code>true</code> if view needs to be re-rendered.
+ */
+ boolean keyReleased(KeyEvent event, ViewPanel viewPanel);
+
+}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui.humaninput;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
*/
public int button;
- public MouseEvent(final int x, final int y, final int button) {
+ MouseEvent(final int x, final int y, final int button) {
this(new Point2D(x, y), button);
}
- public MouseEvent(final Point2D coordinate, final int button) {
+ MouseEvent(final Point2D coordinate, final int button) {
this.coordinate = coordinate;
this.button = button;
}
+ @Override
+ public String toString() {
+ return "MouseEvent{" +
+ "coordinate=" + coordinate +
+ ", button=" + button +
+ '}';
+ }
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui.humaninput;
public interface MouseInteractionController {
/**
- * Called when mouse is clicked on component
- * @return <code>true</code> if view update is needed.
+ * Called when mouse is clicked on component.
+ * @return <code>true</code> if view update is needed as a consequence of this mouse click.
*/
boolean mouseClicked();
/**
* Called when mouse gets over given component.
- * @return <code>true</code> if view update is needed.
+ * @return <code>true</code> if view update is needed as a consequence of this mouse enter.
*/
boolean mouseEntered();
/**
* Called when mouse leaves screen area occupied by component.
- * @return <code>true</code> if view update is needed.
+ * @return <code>true</code> if view update is needed as a consequence of this mouse exit.
*/
boolean mouseExited();
+++ /dev/null
-/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
- */
-
-package eu.svjatoslav.sixth.e3d.gui.humaninput;
-
-import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
-import eu.svjatoslav.sixth.e3d.gui.ViewRenderListener;
-
-import java.awt.event.KeyEvent;
-
-public interface UserInputHandler extends ViewRenderListener {
-
- /**
- * @return <code>true</code> if view update is needed.
- */
- boolean focusLost(ViewPanel viewPanel);
-
- /**
- * @return <code>true</code> if view update is needed.
- */
- boolean focusReceived(ViewPanel viewPanel);
-
- /**
- * @return <code>true</code> if view update is needed.
- */
- boolean keyPressed(KeyEvent event, ViewPanel viewPanel);
-
- /**
- * @return <code>true</code> if view update is needed.
- */
- boolean keyReleased(KeyEvent event, ViewPanel viewPanel);
-
-}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui.humaninput;
import eu.svjatoslav.sixth.e3d.gui.Avatar;
import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
-import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.KeyboardHelper;
+import eu.svjatoslav.sixth.e3d.gui.ViewRenderListener;
import java.awt.event.KeyEvent;
-public class WorldNavigationUserInputTracker implements UserInputHandler {
+public class WorldNavigationUserInputTracker implements KeyboardInputHandler, ViewRenderListener {
@Override
public boolean beforeRender(final ViewPanel viewPanel,
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
public class Character {
+++ /dev/null
-/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
- */
-
-package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
-
-import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
-
-public class ColorConfig {
-
- public Color normalText = new Color(255, 255, 255);
- public Color normalBack = new Color(20, 20, 20, 255);
-
- public Color tabulatorBack = new Color(25, 25, 25, 255);
-
- public Color cursorText = new Color(255, 255, 255);
- public Color cursorBack = new Color(255, 0, 0);
-
- public Color selectedText = new Color(255, 255, 255);
- public Color selectedBack = new Color(0, 80, 80);
-
- public Color pageEnd = new Color(70, 70, 0);
-
-}
+++ /dev/null
-/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
- */
-
-package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
-
-import java.util.HashSet;
-import java.util.Set;
-
-public class KeyboardHelper {
-
- public static final int TAB = 9;
- public static final int DOWN = 40;
- public static final int UP = 38;
- public static final int RIGHT = 39;
- public static final int LEFT = 37;
- public static final int PGDOWN = 34;
- public static final int PGUP = 33;
- public static final int HOME = 36;
- public static final int END = 35;
- public static final int DEL = 127;
- public static final int ENTER = 10;
- public static final int BACKSPACE = 8;
- public static final int ESC = 27;
- public static final int SHIFT = 16;
-
- private static final Set<Integer> nonText;
-
- static {
- nonText = new HashSet<>();
- nonText.add(DOWN);
- nonText.add(UP);
- nonText.add(LEFT);
- nonText.add(RIGHT);
-
- nonText.add(SHIFT);
- nonText.add(ESC);
- }
-
- public static boolean isAlt(final int modifiers) {
- return (modifiers | 8) == modifiers;
- }
-
- public static boolean isCtrl(final int modifiers) {
- return (modifiers | 2) == modifiers;
- }
-
- public static boolean isShift(final int modifiers) {
- return (modifiers | 1) == modifiers;
- }
-
- public static boolean isText(final int keyCode) {
- return !nonText.contains(keyCode);
- }
-
-}
--- /dev/null
+/*
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
+ */
+package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
+
+import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
+
+public class LookAndFeel {
+
+ public Color foreground = new Color(255, 255, 255);
+ public Color background = new Color(20, 20, 20, 255);
+
+ public Color tabStopBackground = new Color(25, 25, 25, 255);
+
+ public Color cursorForeground = new Color(255, 255, 255);
+ public Color cursorBackground = new Color(255, 0, 0);
+
+ public Color selectionForeground = new Color(255, 255, 255);
+ public Color selectionBackground = new Color(0, 80, 80);
+
+}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
import java.util.ArrayList;
public class Page {
- public List<TextLine> lines = new ArrayList<>();
+ public List<TextLine> rows = new ArrayList<>();
public void ensureMaxTextLine(final int row) {
- while (lines.size() <= row)
- lines.add(new TextLine());
+ while (rows.size() <= row)
+ rows.add(new TextLine());
}
public char getChar(final int row, final int column) {
- if (lines.size() <= row)
+ if (rows.size() <= row)
return ' ';
- return lines.get(row).getCharForLocation(column);
+ return rows.get(row).getCharForLocation(column);
}
public TextLine getLine(final int row) {
ensureMaxTextLine(row);
- return lines.get(row);
+ return rows.get(row);
}
public int getLineLength(final int row) {
- if (lines.size() <= row)
+ if (rows.size() <= row)
return 0;
- return lines.get(row).getLength();
+ return rows.get(row).getLength();
}
public int getLinesCount() {
pack();
- return lines.size();
+ return rows.size();
}
public String getText() {
pack();
final StringBuilder result = new StringBuilder();
- for (final TextLine textLine : lines) {
+ for (final TextLine textLine : rows) {
if (result.length() > 0)
result.append("\n");
result.append(textLine.toString());
}
public void insertLine(final int row, final TextLine textLine) {
- lines.add(row, textLine);
+ rows.add(row, textLine);
}
private void pack() {
int newLength = 0;
- for (int i = lines.size() - 1; i >= 0; i--)
- if (!lines.get(i).isEmpty()) {
+ for (int i = rows.size() - 1; i >= 0; i--)
+ if (!rows.get(i).isEmpty()) {
newLength = i + 1;
break;
}
- if (newLength == lines.size())
+ if (newLength == rows.size())
return;
- lines = lines.subList(0, newLength);
+ rows = rows.subList(0, newLength);
}
public void removeCharacter(final int row, final int col) {
- if (lines.size() <= row)
+ if (rows.size() <= row)
return;
getLine(row).removeCharacter(col);
}
public void removeLine(final int row) {
- if (lines.size() <= row)
+ if (rows.size() <= row)
return;
- lines.remove(row);
+ rows.remove(row);
}
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
import eu.svjatoslav.sixth.e3d.gui.GuiComponent;
import eu.svjatoslav.sixth.e3d.gui.TextPointer;
import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
+import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardHelper;
import eu.svjatoslav.sixth.e3d.math.Transform;
-import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.TextCanvas;
import java.awt.*;
public class TextEditComponent extends GuiComponent implements ClipboardOwner {
private static final long serialVersionUID = -7118833957783600630L;
- // lines that need to be repainted
+
+ /**
+ * Text rows that need to be repainted.
+ */
private final Set<Integer> dirtyRows = new HashSet<>();
+
private final TextCanvas textCanvas;
public int scrolledCharacters = 0, scrolledLines = 0;
public boolean selecting = false;
public TextPointer selectionStart = new TextPointer(0, 0);
public TextPointer selectionEnd = new TextPointer(0, 0);
- public TextPointer cursorLocation;
+ public TextPointer cursorLocation = new TextPointer(0, 0);
Page page = new Page();
- ColorConfig colorConfig = new ColorConfig();
+ LookAndFeel lookAndFeel;
boolean repaintPage = false;
public TextEditComponent(final Transform transform,
- final ViewPanel viewPanel, final Point2D size) {
- super(transform, viewPanel, size.to3D());
+ final ViewPanel viewPanel,
+ final Point2D sizeInWorldCoordinates,
+ LookAndFeel lookAndFeel) {
+ super(transform, viewPanel, sizeInWorldCoordinates.to3D());
- cursorLocation = new TextPointer(0, 0);
+ this.lookAndFeel = lookAndFeel;
+ final int columns = (int) (sizeInWorldCoordinates.x / TextCanvas.FONT_CHAR_WIDTH);
+ final int rows = (int) (sizeInWorldCoordinates.y / TextCanvas.FONT_CHAR_HEIGHT);
- // initialize visual panel
-
- final int columns = (int) (size.x / TextCanvas.FONT_CHAR_WIDTH);
- final int rows = (int) (size.y / TextCanvas.FONT_CHAR_HEIGHT);
-
- textCanvas = new TextCanvas(new Transform(), new TextPointer(rows,
- columns), Color.WHITE, colorConfig.normalBack);
+ textCanvas = new TextCanvas(
+ new Transform(),
+ new TextPointer(rows, columns),
+ lookAndFeel.foreground, lookAndFeel.background);
textCanvas.setMouseInteractionController(this);
}
private void processKeyEvent(final KeyEvent event) {
- final int modifiers = event.getModifiers();
-
+ final int modifiers = event.getModifiersEx();
final int keyCode = event.getKeyCode();
final char keyChar = event.getKeyChar();
// System.out.println("Keycode:" + keyCode s+ ", keychar:" + keyChar);
- if (KeyboardHelper.isAlt(modifiers))
+ if (KeyboardHelper.isAltPressed(modifiers))
return;
- if (KeyboardHelper.isCtrl(modifiers)) {
+ if (KeyboardHelper.isCtrlPressed(modifiers)) {
processCtrlCombinations(keyCode);
return;
}
return;
}
- // System.out.println("Co:" + String.valueOf(code) + " Ch:" +
- // String.valueOf(keyChar));
-
- if (KeyboardHelper.isShift(modifiers)) {
+ if (KeyboardHelper.isShiftPressed(modifiers)) {
if (!selecting)
attemptSelectionStart:{
| (keyChar == 8) | (keyChar == 9))
break attemptSelectionStart;
- // System.out.println("Selection started:" + keyChar + " "
- // + keyCode);
-
selectionStart = new TextPointer(cursorLocation);
selectionEnd = selectionStart;
selecting = true;
}
private void processTab(final int modifiers) {
- if (KeyboardHelper.isShift(modifiers)) {
+ if (KeyboardHelper.isShiftPressed(modifiers)) {
if (selectionStart.compareTo(selectionEnd) != 0) {
// dedent multiple lines
ensureSelectionOrder();
identSelection:
{
- // check that identation is possible
+ // check that indentation is possible
for (int y = selectionStart.row; y < selectionEnd.row; y++) {
final TextLine textLine = page.getLine(y);
public void repaintPage() {
- final int chXe = textCanvas.getSize().column + 2;
- final int chYe = textCanvas.getSize().row + 2;
+ final int columnCount = textCanvas.getSize().column + 2;
+ final int rowCount = textCanvas.getSize().row + 2;
- for (int cy = 0; cy < chYe; cy++)
- for (int cx = 0; cx < chXe; cx++) {
- final boolean isTabMargin = ((cx + scrolledCharacters) % 4) == 0;
+ for (int row = 0; row < rowCount; row++)
+ for (int column = 0; column < columnCount; column++) {
+ final boolean isTabMargin = ((column + scrolledCharacters) % 4) == 0;
- if ((cx == (cursorLocation.column - scrolledCharacters))
- & (cy == (cursorLocation.row - scrolledLines))) {
+ if ((column == (cursorLocation.column - scrolledCharacters))
+ & (row == (cursorLocation.row - scrolledLines))) {
// cursor
- textCanvas.setBackgroundColor(colorConfig.cursorBack);
- textCanvas.setForegroundColor(colorConfig.cursorText);
- } else if (new TextPointer(cy + scrolledLines, cx).isBetween(
+ textCanvas.setBackgroundColor(lookAndFeel.cursorBackground);
+ textCanvas.setForegroundColor(lookAndFeel.cursorForeground);
+ } else if (new TextPointer(row + scrolledLines, column).isBetween(
selectionStart, selectionEnd)) {
// selected text
- textCanvas.setBackgroundColor(colorConfig.selectedBack);
- textCanvas.setForegroundColor(colorConfig.selectedText);
+ textCanvas.setBackgroundColor(lookAndFeel.selectionBackground);
+ textCanvas.setForegroundColor(lookAndFeel.selectionForeground);
} else {
// normal text
- textCanvas.setBackgroundColor(colorConfig.normalBack);
- textCanvas.setForegroundColor(colorConfig.normalText);
+ textCanvas.setBackgroundColor(lookAndFeel.background);
+ textCanvas.setForegroundColor(lookAndFeel.foreground);
if (isTabMargin)
textCanvas
- .setBackgroundColor(colorConfig.tabulatorBack);
+ .setBackgroundColor(lookAndFeel.tabStopBackground);
}
- final char charUnderCursor = page.getChar(cy + scrolledLines,
- cx + scrolledCharacters);
+ final char charUnderCursor = page.getChar(row + scrolledLines,
+ column + scrolledCharacters);
- textCanvas.putChar(cy, cx, charUnderCursor);
+ textCanvas.putChar(row, column, charUnderCursor);
}
}
public void repaintRow(final int rowNumber) {
- // TODO: fix this
+ // TODO: Optimize this. No need to repaint entire page.
repaintPage();
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
import java.util.ArrayList;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.io;
import java.io.BufferedReader;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.math;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
-
package eu.svjatoslav.sixth.e3d.math;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.math;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.math;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.octree;
import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.Ray;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*
+*
* Realtime voxel renderer (in software).
* Uses octree for data compression.
*/
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
public class Ray {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
public class RayHit {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*
+*
* Raytracer through voxel data.
*/
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*
+*
* Various 3D renderers utilizing different rendering approaches.
*/
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster;
public final class Color {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*
+*
* <pre>
* Realtime renderer (in software) using traditional approaches:
* Wireframe
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
public abstract class AbstractCoordinateShape extends AbstractShape {
- public static final AtomicInteger lastShapeId = new AtomicInteger();
+ private static final AtomicInteger lastShapeId = new AtomicInteger();
public final int shapeId;
public final GeometryCoordinate[] coordinates;
public double onScreenZ;
shapeId = lastShapeId.getAndIncrement();
}
- public AbstractCoordinateShape(final Point3D... locationPoints) {
- coordinates = new GeometryCoordinate[locationPoints.length];
+ public AbstractCoordinateShape(final Point3D... vertexes) {
+ coordinates = new GeometryCoordinate[vertexes.length];
- for (int i = 0; i < locationPoints.length; i++)
- coordinates[i] = new GeometryCoordinate(locationPoints[i]);
+ for (int i = 0; i < vertexes.length; i++)
+ coordinates[i] = new GeometryCoordinate(vertexes[i]);
shapeId = lastShapeId.getAndIncrement();
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line;
public class LineInterpolator {
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.solidpolygon;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.solidpolygon;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.geometry.Polygon;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape;
+import static eu.svjatoslav.sixth.e3d.geometry.Polygon.pointWithinPolygon;
+
public class SolidPolygon extends AbstractCoordinateShape {
private final static LineInterpolator polygonBoundary1 = new LineInterpolator();
onScreenPoint3.roundToInteger();
if (mouseInteractionController != null)
- if (context.mouseEvent != null)
- if (Polygon.pointWithinPolygon(context.mouseEvent.coordinate,
+ if (context.getMouseEvent() != null)
+ if (pointWithinPolygon(context.getMouseEvent().coordinate,
onScreenPoint1, onScreenPoint2, onScreenPoint3))
- context.objectUnderMouse = mouseInteractionController;
+ context.setObjectUnderMouse(mouseInteractionController);
if (color.isTransparent())
return;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.texturedpolygon;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.texturedpolygon;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
projectedPoint3.roundToInteger();
if (mouseInteractionController != null)
- if (renderBuffer.mouseEvent != null)
+ if (renderBuffer.getMouseEvent() != null)
if (pointWithinPolygon(
- renderBuffer.mouseEvent.coordinate, projectedPoint1,
+ renderBuffer.getMouseEvent().coordinate, projectedPoint1,
projectedPoint2, projectedPoint3))
- renderBuffer.objectUnderMouse = mouseInteractionController;
+ renderBuffer.setObjectUnderMouse(mouseInteractionController);
// Show polygon boundaries (for debugging)
if (showBorders)
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
final eu.svjatoslav.sixth.e3d.renderer.raster.Color textColor) {
final Texture texture = new Texture(text.length()
- * TextCanvas.FONT_CHAR_WIDTH, TextCanvas.FONT_CHAR_HEIGHT,
+ * TextCanvas.FONT_CHAR_WIDTH_TEXTURE_PIXELS, TextCanvas.FONT_CHAR_HEIGHT_TEXTURE_PIXELS,
maxUpscaleFactor);
// texture.graphics.setColor(Color.BLUE);
for (int c = 0; c < text.length(); c++)
texture.graphics.drawChars(new char[]{text.charAt(c),}, 0, 1,
- (c * TextCanvas.FONT_CHAR_WIDTH) - 0,
- (0 * TextCanvas.FONT_CHAR_HEIGHT) + 11);
+ (c * TextCanvas.FONT_CHAR_WIDTH_TEXTURE_PIXELS),
+ (int) (TextCanvas.FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.45));
return texture;
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
addShape(texturedPolygon2);
}
- public void initialize(final int width, final int height,
- final int maxTextureUpscale) {
- initialize(width, height, width, height, maxTextureUpscale);
- }
+// public void initialize(final int width, final int height,
+// final int maxTextureUpscale) {
+// initialize(width, height, width, height, maxTextureUpscale);
+// }
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.solid;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.solid;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
public class CanvasCharacter extends AbstractCoordinateShape {
- public static final double SIZE_MULTIPLIER = 0.005;
private static final int MAX_FONT_SIZE = 500;
private static final Font[] fonts = new Font[MAX_FONT_SIZE];
private String value;
renderingContext.graphics.setFont(getFont(size));
renderingContext.graphics.setColor(foregroundAwtColor);
- renderingContext.graphics.drawString(value, (int) onScreenLocation.x
- - (int) (size / 3.2), (int) onScreenLocation.y
- + (int) (size / 2.5));
+ renderingContext.graphics.drawString(
+ value,
+ (int) onScreenLocation.x - (int) (size / 3.2),
+ (int) onScreenLocation.y + (int) (size / 2.5));
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas;
public enum RenderMode {
- TEXTURE, CHARACTERS
+ TEXTURE, // Text is rendered on textured polygon
+ CHARACTERS // Text is rendered as high quality, anti-aliazed tiles
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import java.io.IOException;
import java.io.StringReader;
+import static eu.svjatoslav.sixth.e3d.renderer.raster.Color.BLACK;
+import static eu.svjatoslav.sixth.e3d.renderer.raster.Color.WHITE;
+
public class TextCanvas extends TexturedRectangle {
+ // character size in world coordiates
public static final int FONT_CHAR_WIDTH = 8;
public static final int FONT_CHAR_HEIGHT = 16;
- public static final Font FONT = CanvasCharacter.getFont(15);
+
+ // character size on texture
+ public static final int FONT_CHAR_WIDTH_TEXTURE_PIXELS = 16;
+ public static final int FONT_CHAR_HEIGHT_TEXTURE_PIXELS = 32;
+
+
+ public static final Font FONT = CanvasCharacter.getFont((int)(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.066));
private static final String GROUP_TEXTURE = "texture";
private static final String GROUP_CHARACTERS = "characters";
private final TextPointer size;
private final TextPointer cursorLocation = new TextPointer();
CanvasCharacter lines[][];
private RenderMode renderMode = null;
- private Color backgroundColor = Color.BLACK;
-
- private Color foregroundColor = Color.WHITE;
+ private Color backgroundColor = BLACK;
+ private Color foregroundColor = WHITE;
public TextCanvas(final Transform location, final String text,
final Color foregroundColor, final Color backgroundColor) {
this.foregroundColor = foregroundColor;
// initialize underlying textured rectangle
- initialize(columns * FONT_CHAR_WIDTH, rows * FONT_CHAR_HEIGHT, 0);
+ initialize(
+ columns * FONT_CHAR_WIDTH,
+ rows * FONT_CHAR_HEIGHT,
+ columns * FONT_CHAR_WIDTH_TEXTURE_PIXELS,
+ rows * FONT_CHAR_HEIGHT_TEXTURE_PIXELS,
+ 0);
getTexture().primaryBitmap.fillColor(backgroundColor);
getTexture().resetResampledBitmapCache();
final char character, final Color foreground) {
final Graphics2D graphics = getTexture().graphics;
- getTexture().primaryBitmap.drawRectangle(column * FONT_CHAR_WIDTH, row
- * FONT_CHAR_HEIGHT, (column * FONT_CHAR_WIDTH)
- + FONT_CHAR_WIDTH, (row * FONT_CHAR_HEIGHT) + FONT_CHAR_HEIGHT,
+ getTexture().primaryBitmap.drawRectangle(
+ column * FONT_CHAR_WIDTH_TEXTURE_PIXELS,
+ row * FONT_CHAR_HEIGHT_TEXTURE_PIXELS,
+ (column * FONT_CHAR_WIDTH_TEXTURE_PIXELS) + FONT_CHAR_WIDTH_TEXTURE_PIXELS,
+ (row * FONT_CHAR_HEIGHT_TEXTURE_PIXELS) + FONT_CHAR_HEIGHT_TEXTURE_PIXELS,
backgroundColor);
graphics.setFont(FONT);
graphics.setColor(foreground.toAwtColor());
- graphics.drawChars(new char[]{character,}, 0, 1,
- (column * FONT_CHAR_WIDTH) - 0, (row * FONT_CHAR_HEIGHT) + 13);
+ graphics.drawChars(
+ new char[]{character,}, 0, 1,
+ (column * FONT_CHAR_WIDTH_TEXTURE_PIXELS) - 0,
+ (row * FONT_CHAR_HEIGHT_TEXTURE_PIXELS) + (int)(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.23f));
getTexture().resetResampledBitmapCache();
}
final Point3D coordinate = topLeft.clone();
coordinate.translateY((row * FONT_CHAR_HEIGHT)
- + ((FONT_CHAR_HEIGHT / 2) - 3));
+ + (FONT_CHAR_HEIGHT / 3.2));
coordinate.translateX((column * FONT_CHAR_WIDTH)
+ (FONT_CHAR_WIDTH / 2));
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
public class Grid2D extends AbstractCompositeShape {
+ /**
+ * @param transform Grid location
+ * @param rectangle Grid dimensions
+ * @param xDivisionCount Division count along X axis
+ * @param yDivisionCount Division count along Y axis
+ * @param appearance Grid lines appearance
+ */
public Grid2D(final Transform transform, final Rectangle rectangle,
- final int divisionsX, final int divisionsY,
+ final int xDivisionCount, final int yDivisionCount,
final LineAppearance appearance) {
super(transform);
- final double stepY = rectangle.getHeight() / divisionsY;
- final double stepX = rectangle.getWidth() / divisionsX;
+ final double stepY = rectangle.getHeight() / yDivisionCount;
+ final double stepX = rectangle.getWidth() / xDivisionCount;
- for (int yslice = 0; yslice <= divisionsY; yslice++) {
- final double y = (yslice * stepY) + rectangle.getLowerY();
+ for (int ySlice = 0; ySlice <= yDivisionCount; ySlice++) {
+ final double y = (ySlice * stepY) + rectangle.getLowerY();
- for (int xslice = 0; xslice <= divisionsX; xslice++) {
- final double x = (xslice * stepX) + rectangle.getLowerX();
+ for (int xSlice = 0; xSlice <= xDivisionCount; xSlice++) {
+ final double x = (xSlice * stepX) + rectangle.getLowerX();
final Point3D p1 = new Point3D(x, y, 0);
final Point3D p2 = new Point3D(x + stepX, y, 0);
final Point3D p3 = new Point3D(x, y + stepY, 0);
- if (xslice < divisionsX)
+ if (xSlice < xDivisionCount)
addShape(appearance.getLine(p1, p2));
- if (yslice < divisionsY)
+ if (ySlice < yDivisionCount)
addShape(appearance.getLine(p1, p3));
}
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe;
import eu.svjatoslav.sixth.e3d.geometry.Box;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.slicer;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.slicer;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.slicer;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.texturedpolygon.TexturedPolygon;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.texture;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
/*
- * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.renderer.raster.texture;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
+++ /dev/null
-package eu.svjatoslav.sixth.e3d;
-
-import eu.svjatoslav.inspector.java.structure.ClassGraph;
-
-public class VisualizeCode {
-
- public static void main(String[] args) {
- renderGui();
- renderRasterGrphicsEngine();
- }
-
- private static void renderGui() {
- final ClassGraph graph = new ClassGraph();
- graph.addProject("./src/main/");
- graph.whitelistClassPattern("eu.svjatoslav.sixth.e3d.gui.*");
- graph.generateGraph("gui");
- }
-
- private static void renderRasterGrphicsEngine() {
- final ClassGraph graph = new ClassGraph();
- graph.addProject("./src/main/");
- graph.whitelistClassPattern("eu.svjatoslav.sixth.e3d.renderer.raster.*");
- graph.generateGraph("raster engine");
- }
-
-}
/*
* Sixth - System for data storage, computation, exploration and interaction.
- * Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- */
+*/
package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
#!/bin/bash
-cd "${0%/*}"
+#
+# This is a helper bash script that starts IntelliJ with the current project.
+# Script is written is such a way that you can simply click on it in file
+# navigator to run it.
+#
+#
+# Script assumes:
+#
+# + GNU operating system
+# + IntelliJ is installed and commandline launcher "idea" is enabled.
+#
+cd "${0%/*}"
cd ..
-idea .
+
+setsid idea . &>/dev/null
rm -rf doc/graphs/
mkdir -p doc/graphs/
-javainspect -j target/sixth-3d-*-SNAPSHOT.jar -d doc/graphs/ -n "all classes" -t png -h
-javainspect -j target/sixth-3d-*-SNAPSHOT.jar -d doc/graphs/ -n "GUI" -t png -w "eu.svjatoslav.sixth.e3d.gui.*" -h
-javainspect -j target/sixth-3d-*-SNAPSHOT.jar -d doc/graphs/ -n "raster engine" -t png -w "eu.svjatoslav.sixth.e3d.renderer.raster.*" -h
+javainspect -j target/sixth-3d-*-SNAPSHOT.jar -d doc/graphs/ -n "all classes" -t png -ho
+javainspect -j target/sixth-3d-*-SNAPSHOT.jar -d doc/graphs/ -n "GUI" -t png -w "eu.svjatoslav.sixth.e3d.gui.*" -ho
+javainspect -j target/sixth-3d-*-SNAPSHOT.jar -d doc/graphs/ -n "raster engine" -t png -w "eu.svjatoslav.sixth.e3d.renderer.raster.*" -ho
meviz index -w doc/graphs/ -t "Sixth 3D classes"
+rm -rf doc/apidocs/
+cp -r target/apidocs/ doc/
+
rsync -avz --delete -e 'ssh -p 10006' doc/ n0@www3.svjatoslav.eu:/mnt/big/projects/sixth-3d/
echo ""