This project is a unique exploration into the world of 3D rendering within the familiar confines of Microsoft Excel. The primary goal is to understand and implement the basic principles of rendering 3D objects, with a specific focus on cubes inspired by the iconic game Minecraft. This project is part of final work of Thesis for Programming Seminar 2023/2024.
Objective: Delve into the fundamental principles of 3D rendering. Inspiration: Draw inspiration from the global trend of porting older games, like Doom, into diverse environments. Implementation: Integrate basic graphical rendering of cubes into the Microsoft Excel environment. Focus Areas: Explore Excel as a platform for programming 3D games, emphasizing camera rotation, player movement, and visualization aspects. Optimization: Optimize code to minimize computations and enhance overall program speed. What to Expect:
Theoretical Foundation: Understand the algorithms and mathematics behind 3D space movement. Implementation Details: Dive into the specific integration of 3D rendering into the Excel environment. Optimization Strategies: Address environment limitations and explore opportunities for program enhancement. Why Minecraft-Excel? This project serves as a creative endeavor to showcase the possibilities of combining spreadsheet software with 3D rendering. While Excel may seem an unconventional choice, the aim is to push the boundaries and provide a unique perspective on the fundamentals of 3D environments.
Note: The journey begins with a theoretical exploration, moves on to the nitty-gritty details of implementation, and concludes with optimization strategies. So, buckle up and let's explore the fascinating intersection of Excel and 3D rendering!
- Basic implementation of 3D positions of blocks and conversion into 2D based on Perspective projection
- Pixel rendering based on Brehensam line algorithm
- Fully VBA implementation; O(n^3); 50 cubes avrg. 1 minute of render time
To run the Minecraft-Excel 3D Renderer, ensure your system meets the following requirements:
-
Microsoft Excel:
- Version: Excel 2016 or older
- Edition: .exe version (not web app)
-
Operating System:
- Windows: 7 and above
- Mac: macOS 12.0 and above
Please note that this project is designed to work with specific versions of Microsoft Excel and operating systems. Compatibility with other versions or platforms is not guaranteed. Ensure your system aligns with the specified requirements for the optimal functioning of the Minecraft-Excel 3D Renderer.
Follow these steps to install the Minecraft-Excel 3D Renderer:
-
Download Minecraft.xlsm:
- Download the
CubesRendering.xlsmfile from the project repository.
- Download the
-
Open File Properties:
- Right-click on the downloaded file.
- Go to "Properties."
-
General - Security Unblock:
- In the General tab, locate the "Security" section.
- Check the "Unblock" option.
- Click "OK" to confirm.
-
Open File in Excel:
- Double-click on the
CubesRendering.xlsmfile to open it in Microsoft Excel.
- Double-click on the
-
Access Excel Options:
- Go to the "File" tab in Excel.
-
Navigate to Options:
- Click on "Options" at the bottom of the left-hand panel.
-
Trust Center Settings:
- In the Excel Options dialog box, select "Trust Center" from the left-hand menu.
-
Macro Settings:
- Click on "Trust Center Settings."
-
Enable Macros:
- In the Trust Center dialog, choose "Macro Settings."
- Select the option "Enable all macros."
- Click "OK" to confirm.
-
Enable Content:
- Close the options and click on "Enable Content" in the top line (Security warning - macros have been disabled).
You're now ready to explore the Minecraft-Excel 3D Renderer! Ensure that you've followed each step carefully to enable macros and unlock the full functionality of the program in Microsoft Excel.
If you prefer a manual installation or encounter any issues with the provided file, you can follow these steps to set up the Minecraft-Excel 3D Renderer:
-
Create a New Excel File (.xlsm):
- Open Microsoft Excel.
- Create a new Excel file and save it with the extension
.xlsm.
-
Access Visual Basic for Applications (VBA):
- Go to the "Developer" tab in Excel. (Note: If the Developer tab is not visible, you can enable it in Excel options.)
-
Open Visual Basic:
- Click on "Visual Basic" in the Developer tab to open the Visual Basic for Applications (VBA) editor.
-
Insert Modules and Class Modules:
-
In the VBA editor, you'll see a project explorer on the left.
-
Right-click on your Excel file in the project explorer.
-
Choose "Import File" and manually add the following from
vba-versionfiles into the Macros:.basfiles: These are module files..clsfiles: These are class module files.
-
-
Compile Code:
- Ensure that all the modules and class modules are successfully imported.
- Compile the code to check for any errors.
-
Save and Close:
- Save your Excel file.
- Close the VBA editor.
-
Enable Macros:
- Follow steps 5-10 from the previous installation instructions to enable macros and content in Excel.
You've now manually set up the Minecraft-Excel 3D Renderer by importing the necessary modules and class modules into the VBA editor. This alternative method allows for a more hands-on approach to the installation process. Explore and enjoy the 3D rendering capabilities within Excel!
Experience Minecraft in Excel with these keyboard shortcuts. Ensure to bind these keys by using the 'Start' button on the 'Data' sheet. Note that all keys require the 'Shift' modifier.
-
Move Up/Down
- Shortcut: Shift + Spacebar (Up), Shift + 'X' key (Down)
- Description: Navigate along the Y-axis, allowing upward and downward movement.
-
Move Left/Right
- Shortcut: Shift + 'A' key (Left), Shift + 'D' key (Right)
- Description: Move along the X and Z axes, adjusting for camera orientation.
-
Move Front/Back
- Shortcut: Shift + 'W' key (Front), Shift + 'S' key (Back)
- Description: Move forward and backward along the X and Z axes, considering camera orientation.
-
Look Up/Down
- Shortcut: Shift + 'R' key (Look Up), Shift + 'F' key (Look Down)
- Description: Adjust the camera's pitch (X-axis rotation) for a vertical view.
-
Look Left/Right
- Shortcut: Shift + 'Q' key (Look Left), Shift + 'E' key (Look Right)
- Description: Control the camera's yaw (Y-axis rotation) to rotate around your own axis.
Or with buttons located in the 'Data' sheet.
Customize the visual output of the program by adjusting these key parameters located in 'Data' sheet:
-
Blocksize
- Description: Determines the length of each cube's side, serving as the coordinate scale.
-
Screen Width & Screen Height
- Description: Represents the screen size in terms of cells.
-
Movement & Rotation Coefficient
- Description: Scales player movement in specific directions and camera rotation in degrees along specific axes.
-
InstantDrawing
- Description: Influences whether cells are gradually colored, aiding in visualizing the rendering process, or if all cells are colored without incremental rendering for faster display.
Customize cube textures and their center positions:
- Default Texture: NONE (not included)
- Available Textures: Choose from 16 predefined textures.
- Coordinates: Ensure unique coordinates as multiples of the cube's side length (Blocksize) to prevent overlap.
- Half-block (slab): Choose block type (block / slab)
I made custom and easy program where you can build the objects with given block textures and then export it. The 3D enviroment for building is made in made in roblox, because of easy distribution and easy implementation features.
- Open the program by joining the experience or executing the file directly in Studio.
- Wait for all assets to load and you will be put into free camera mode.
- Equip building mode by pressing key "1" [1].
- Select texture type from the left of the screen [2].
- Place a block by clicking on other side of blocks or floor, hold shift while clicking to remove it.
- After you are done building click on the Show Results [3].
- A text box will appear. Copy the text of the box and paste it into the Excel program.
- Click Clear Blocks to clear all blocks
- Paste the text of the blocks into textbox on right top of the screen [5] and press Load Blocks [6] to load blocks into this block editor to continue your progress.
- To add custom textures in that building program, you need to modify the script of the file.
Link to the file is Block Builder.rbxl
In Textures sheet insert float number into the cell of the block texture. 0 = transparent, 1 = fully visible, 0,5 half visible Be sure to not change the data format of the cell. Keep it on "Text" Use comma, not period of the floats Keep blank to set it to 1 (default)
Explore the available cube textures through this list.
Track program speed through precise timestamps:
- Start Time: Displays when the program was initiated.
- Function Completion Times: Indicates when individual frame calculation functions were completed.
- Total Frame Calculation Time: Shows the overall time for frame calculation from user input to cell display completion. Utilize this indicator for program optimization and testing.
Note: Modify cube textures in the 3rd sheet named "Textures" to personalize the appearance of the cubes in the program.
Modified version of program can take automaticly screenshots and render frames without any user interaction. Modified version of the program and the sample animations are located in: Animations
- Add SaveRangeAsPNG Sub from
_addToMain.basinto Main.bas - You can create simmilar Sub like LoopThroughNumbers Sub to auto-rotate camera around the build. Add to the end of the Sub Move Sub.
- If you are using any Sub from Keys.bas, you should disable (comment with ' the Move at the end of each Key-Sub, in order to stop multiple rendering of the same time)
After you can use any program to make gif/video out of the png frames.
This program was created with passion and dedication by Ondřej Čopák. Special thanks to the following contributors and resources:
ProfiPoint 2023
Feel free to use this program for your own purposes, modify it, or integrate it into your projects. All I ask is proper crediting. If you find this tool helpful, give credit where credit is due.
- If you use this program in your project, mention in your documentation or credits that you utilized "Minecraft Excel" created by [Ondřej Čopák].
- Provide a link to the GitHub repository for others to explore and benefit.
Your support and adherence to these guidelines are greatly appreciated. Let's build and create together!
Description generated by AI




