Categories
Game Creation Mastering Development

Voxelizing a mesh using FAABB to get volume data

I want to solid-voxelize a mesh in c++ and get a volume data with faabb bounding and voxel array , this is my code but it’s not working and I can’t understand where it goes wrong. void Voxelize(const Mesh& mesh, Volume* volume, Neighborhood neighborhood) { assert(mesh.Indices.size() % 3 == 0); const auto& Vertices = mesh.Vertices; […]

Categories
Mastering Development

How to find the shortest route between two coordinates in a 2-dimensional array?

I am trying to find the shortest way to get from one point in a 2D array (one coordinate with x and y values representing its position in the array) to another. I would like to output an array of coordinates which must be travelled through to get from the initial to the final coordinates. […]

Categories
Mastering Development

Array Object Value Not Displaying

I’m trying to cleanse some data and place an array of objects inside of an object. Here’s my array of objects. careerStats: [ { gp: ’35’, gs: ’34’, mpg: ‘33.2’, fg: ‘.515’, tp: ‘1.5’, ft: ‘1.4’, rpg: ‘0.5’, apg: ‘0.7’, bpg: ‘.692’, spg: ‘0.7’, ppg: ‘3.6’ }, { gp: ’22’, gs: ’22’, mpg: ‘36.7’, fg: […]

Categories
Game Creation Mastering Development

How to Instantiate an array of Prefabs THROUGH ONE in C# (Unity)

I need to instantiate an array of 2 elements that is floors of black and white color throught one so it looks like a chess board. It is for my game that have 2D Dungeon Generation. public enum TileType { Wall, Floor, } public GameObject[] floorTiles; public GameObject[] wallTiles; public GameObject[] outerWallTiles; private TileType[][] tiles; […]

Categories
Game Creation Mastering Development

Unity drop items enemy sprite size problem

how can i make items drop infront of the enemy without getting hidden under the enemy sprite due to the size of different enemies. I would also like to spread the drop items How currently it is How i would like it to be My code: public void TakeDamage(int damage) { int dist = 10; […]

Categories
Game Creation Mastering Development

XNA Rotate Vector2 around Origin

I have a Rectangle and a Vector2 position, my sprite is being drawn at this position. The rectangle is meant to be a collision system with the cursor, when I rotate my sprite around the origin and stuff in a draw call public virtual void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(texture, position, null, Color.White, rot, Origin, SCALEFACTOR, […]

Categories
Mastering Development

Passing a file via command arguement into an array

So I’m trying to pass and command line argument into an array in my int main like this $< .\program nums.txt 8 but I’m getting errors and hit a dead-end with my knowledge on C++ code. (I’m relatively a new coder). Any help is greatly appreciated. int main(int argc,char *argv[]) { string arg2=” “; arg2 […]

Categories
Mastering Development

How to grab a specific part of a page and Decode it

I am trying to grab a specific part of the following page then decode it so it outputs the Results but it only grabs part of it… Here is the code i am attempting to use to complete this task Goal <?php class JavaScriptUnpacker { private $unbaser; private $payload; private $symtab; private $radix; private $count; […]

Categories
Mastering Development

PHP from is not updating values

I am following a course on PHP and MySQL from Kevin Skuglund of Lynda.com. this is the file new_subject.php where form values is entered. <?php session_start(); ?> <?php include(“../includes/functions.php”);?> <?php include(“../includes/db_connection.php”);?> <?php include(“../includes/layouts/header.php”);?> <?php if (isset($_GET[“subject”])){ $selected_subject_id = null; $selected_subject_id = ($_GET[“subject”]); $current_subject_id = find_subject_by_id($selected_subject_id); } elseif (isset($_GET[“page”])){ $selected_page_id = null; $selected_page_id = ($_GET[“page”]); $current_page_id […]

Categories
Mastering Development

Why I am receiving a 400 bad request status when trying to upload image through to react to post to DRF createAPIView?

I am trying to post images to my drf API using react dropzone. However, when I try to submit I get the 400 bad request error. It has to do with my endpoint in axios when I call handleSubmit(). When I look at the network tools in the browser console, Headers shows that FormData is […]