voxel

c++ 12bit variable, how can I do this?

只谈情不闲聊 提交于 2021-02-10 06:21:50
问题 I'm building a voxel engine so I have concerns about memory usage, using 12bit instead of 16bit block ids could save a lot of memory. I have a 3D array of block ids, each id has a static configuration. I'm not sure what a good way to achieve this would be. Is there a way to just get a block of raw memory and manage it myself and would this be a good idea; are there any problems I might run into? Is there a better way to do this? I have some experience with c++, but most of my time was spent

c++ 12bit variable, how can I do this?

落花浮王杯 提交于 2021-02-10 06:21:10
问题 I'm building a voxel engine so I have concerns about memory usage, using 12bit instead of 16bit block ids could save a lot of memory. I have a 3D array of block ids, each id has a static configuration. I'm not sure what a good way to achieve this would be. Is there a way to just get a block of raw memory and manage it myself and would this be a good idea; are there any problems I might run into? Is there a better way to do this? I have some experience with c++, but most of my time was spent

Auto-balancing (or cheaply balanced) 3D datastructure

戏子无情 提交于 2020-01-16 04:28:05
问题 I am working on a tool that requires a 3D "voxel-based" engine. By that I mean it will involve adding and removing cubes from a grid. In order to manage these cubes I need a data structure that allows for quick insertions and deletes. The problem I've seen with k-d trees and octrees is that it seems like they would frequently need to be recreated (or at least rebalanced) because of these operations. Before I jumped in I wanted to get opinions on what the best way to go about this would be.

webgl glsl emulate texture3d

▼魔方 西西 提交于 2020-01-05 02:33:09
问题 I'm porting a piece of opengl to webgl and i'm trying to emulate texture3d. Somehow something is going wrong. No interpolation is needed because it is only used for calculations. I'm not sure about the geometry part of the original code, the per layer properties are now fetched trough a texture. Update : Ok i rewrote the texture 3d functions, I still encounter some problems : const vec3 volumeTextureSize = vec3( 256.0, 128.0, 32.0 ); const vec2 imageSize = vec2( 1024.0, 1024.0 ); vec2

Where to start with voxel engine?

拜拜、爱过 提交于 2020-01-03 03:48:08
问题 I have been working on a voxel game for some time now, but all that I have really accomplished was the main menu and an Item system. Now its time to make the voxel engine. I have been searching for a while now to find some tutorials or an ebook that will teach me such, but the best i could find were someones tutorials in c++, but I am making mine in Java. I have dabbled in c++ and c# in the past but it was too difficult to translate i.e. it relied on a class that java doesn't have. What I

Drawing 3D sphere in C/C++

时间秒杀一切 提交于 2019-12-28 02:13:37
问题 I am looking for an algorithm which can draw a nice looking 3D sphere on small resolution. I found Bresenham's circle algorithm but it's for 2D drawing. I just need spheres borders (I don't need it filled). I also googled for a solution of the problem but I didn't find anything. This article doesn't help (what is the brute force algorithm?). I can't use any OpenGL libraries, I need vanilla C/C++ solution. Thank you in advance. 回答1: if I get it right you want to render all surface Voxels of

Contour plot on the surface of a 3D cylinder

痴心易碎 提交于 2019-12-20 05:53:30
问题 Because of your great help I can now plot a 3D cylinder with a hole inside :) This is my code: import numpy as np import matplotlib as mlp import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as axes3d inner_radius = 100 outer_radius = 300 height=50 # input xy coordinates input_xy = np.array([[ri,0],[ra,0],[ra,h],[ri,h],[ri,0]]) # radial component is x values of input r = xy[:,0] # angular component is one revolution of 30 steps phi = np.linspace(0, 2*np.pi, 30) # create grid R