Giter Club home page Giter Club logo

quill's Introduction

quill

Texture pack renderer

Progress

  • Draw a plane
  • Orbit camera
  • Draw test cube(unique faces)
  • Use from and to for cube corners
  • Only draw 2 faces if the defined element is flat
  • Scale UV coords
  • Read element from json
  • GUI

Rendering scheme

  v5 ----------- v4
  /|            /|      Axis orientation    North orientation
 / |           / |
v6 --------- v7  |      y
|  |         |   |      |                       
|  v2 -------|-- v3     +--- x                 /
| /          |  /      /                      /
|/           | /      z                     North
v1 --------- v0


Triangle primitives must be drawn in a anticlockwise order when looking from the outside

(0,0) v1 --------- v0 (1,0)
      |          / |
      |        /   |
      |      /     |
      |    /       |						^
      |  /         |						|
(0,1) v2 --------- v3 (1,1)				Texture Up

JSON Order:
	down
	up
	north
	south
	west
	east

Vertex draw order: 
	0, 1, 2,    0, 2, 3,	// Down -Y
	4, 5, 6, 	4, 6, 7,	// Up +Y
	5, 4, 3, 	5, 3, 2,	// North -Z
	7, 6, 1, 	7, 1, 0,	// South +Z
	6, 5, 2, 	6, 2, 1,	// West -X
	4, 7, 0, 	4, 0, 3		// East +X

VBO and EBO

mVertices[120] = {
			// Down -Y
			 0.5f, -0.5f,  0.5f, 1.0f, 0.0f,    // 0
			-0.5f, -0.5f,  0.5f, 0.0f, 0.0f,    // 1
			-0.5f, -0.5f, -0.5f, 0.0f, 1.0f,    // 2
			 0.5f, -0.5f, -0.5f, 1.0f, 1.0f,    // 3
			// Up +Y
			 0.5f,  0.5f, -0.5f, 1.0f, 0.0f,    // 4
			-0.5f,  0.5f, -0.5f, 0.0f, 0.0f,    // 5
			-0.5f,  0.5f,  0.5f, 0.0f, 1.0f,    // 6
			 0.5f,  0.5f,  0.5f, 1.0f, 1.0f,    // 7
			// North -Z
			-0.5f,  0.5f, -0.5f, 1.0f, 0.0f,    // 5
			 0.5f,  0.5f, -0.5f, 0.0f, 0.0f,    // 4
			 0.5f, -0.5f, -0.5f, 0.0f, 1.0f,    // 3
			-0.5f, -0.5f, -0.5f, 1.0f, 1.0f,    // 2
			// South +Z
			 0.5f,  0.5f,  0.5f, 1.0f, 0.0f,    // 7
			-0.5f,  0.5f,  0.5f, 0.0f, 0.0f,    // 6
			-0.5f, -0.5f,  0.5f, 0.0f, 1.0f,    // 1
			 0.5f, -0.5f,  0.5f, 1.0f, 1.0f,    // 0
			// West -X
			-0.5f,  0.5f,  0.5f, 1.0f, 0.0f,    // 6
			-0.5f,  0.5f, -0.5f, 0.0f, 0.0f,    // 5
			-0.5f, -0.5f, -0.5f, 0.0f, 1.0f,    // 2
			-0.5f, -0.5f,  0.5f, 1.0f, 1.0f,    // 1
			// East +X
			 0.5f,  0.5f, -0.5f, 1.0f, 0.0f,    // 4
			 0.5f,  0.5f,  0.5f, 0.0f, 0.0f,    // 7
			 0.5f, -0.5f,  0.5f, 0.0f, 1.0f,    // 0
			 0.5f, -0.5f, -0.5f, 1.0f, 1.0f,    // 3
		}
		
mIndices[36] = {
			0, 1, 2,    	0, 2, 3,	// Down -Y
			4, 5, 6, 		4, 6, 7,	// Up +Y
			8, 9, 10, 		8, 10, 11,	// North -Z
			12, 13, 14, 	12, 14, 15,	// South +Z
			16, 17, 18, 	16, 18, 19,	// West -X
			20, 21, 22, 	20, 22, 23	// East +X
		};

Good references:

Gui elements:

  • Textures / UV display
  • JSON editor
  • Minecraft GUI views
  • Hide elements, choose which ones to view
  • Block selector

General:

  • Texture pack importer
  • Default texture pack for parents that aren't included with the user texture pack
  • JSON parser
  • Renderer
  • Parent model / texture inheritance

Eventual:

  • How to update the default texture pack as the game updates

Reference for camera.h https://github.com/DethRaid/minecraft-texture-viewer/blob/master/src/render/camera.h https://github.com/yocover/start-learning-opengl

VAO VBO to merge into one model/element class https://github.com/VictorGordan/opengl-tutorials

Shader.cpp for shader as a shader program https://github.com/amanshenoy/mesh-viewer

quill's People

Contributors

alieron avatar

Watchers

 avatar

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

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

  • D3 photo D3

    Data-Driven Documents codes.