Skip to content

Instantly share code, notes, and snippets.

View Pikachuxxxx's full-sized avatar
😎
lol

Phani Srikar Pikachuxxxx

😎
lol
View GitHub Profile
@Pikachuxxxx
Pikachuxxxx / ElsevierTemplate.tex
Created June 6, 2021 12:09
Basic Research Paper Template for Elsevier Journals
% Choose between the required format of the article (review copy vs final print)
\documentclass[final, 5p, times, 12]{elsarticle}
%\documentclass[preprint, 12]{elsarticle}
% External Packages
% Journal Name
\journal{Name of the Journal}
% Beginning of the document
\begin{document}
@Pikachuxxxx
Pikachuxxxx / RigToMeshBlender.py
Created April 1, 2021 13:43
A Blender Script to Convert any Rig to Mesh
import bpy
import mathutils
from mathutils import Vector
from math import *
def CreateMesh():
obj = bpy.context.active_object
if obj == None:
@Pikachuxxxx
Pikachuxxxx / CMakeAutoVSFilters.md
Last active February 2, 2021 15:04
How auto-place the ALL_BUILD and ZERO_CHECK and INSTALL projects from CMake into a Visual Studio filter

For anyone else curious I found the answer.

In the CMakeLists.txt add the following commands:

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(PREDEFINED_TARGETS_FOLDER "CustomTargets")

Now the ALL_BUILD, ZERO_CHECK, and even INSTALL projects will all be placed in a Visual Studio Filter called CMakePredefinedTargets

@Pikachuxxxx
Pikachuxxxx / WAVExporter.cpp
Last active April 26, 2021 20:07
A code snippet to create and write audio data to .WAV audio file format
#include <iostream>
#include <cstdint>
/*******************************************************************************
WAVE File chunks overview
____________________________
| RIFF WAVE Chunk |
| groupID = 'RIFF' |
| riffType = 'WAVE' |
| __________________ |
| | Format Chunk | |
@Pikachuxxxx
Pikachuxxxx / Sphere.cpp
Last active July 24, 2024 19:12
A script to generate an UV Sphere vertices, normals, texture coordinates and Indices.
std::vector<glm::vec3> sphereVertices;
std::vector<glm::vec3> sphereNormals;
std::vector<glm::vec2> sphereUVs;
std::vector<unsigned int> sphereIndices;
void GenerateSphereSmooth(int radius, int latitudes, int longitudes)
{
if(longitudes < 3)
longitudes = 3;
if(latitudes < 2)
@Pikachuxxxx
Pikachuxxxx / ImGuiTransformUI.cpp
Last active October 14, 2024 07:40
ImGui Transform Component with RBG for XYZ than can be used for position, rotation and scaling components
void DrawVec3Control(const std::string& label, glm::vec3& values, float resetValue = 0.0f, float columnWidth = 100.0f)
{
ImGuiIO& io = ImGui::GetIO();
auto boldFont = io.Fonts->Fonts[0];
ImGui::PushID(label.c_str());
ImGui::Columns(2);
ImGui::SetColumnWidth(0, columnWidth);
ImGui::Text("%s", label.c_str());
@Pikachuxxxx
Pikachuxxxx / Cylinder.cpp
Last active March 26, 2024 22:56
A script to generate Cylinder/Cone vertices, indices, normals and uv coordinates
std::vector<glm::vec3> cylinderVertices;
std::vector<glm::vec3> cylinderNormals;
std::vector<glm::vec2> cylinderUVs;
std::vector<unsigned int> cylinderIndices;
void GenerateCylinder(int baseRadius, int topRadius, int height, int sectorCount)
{
std::vector<glm::vec3> vertices;
std::vector<glm::vec3> normals;
std::vector<glm::vec2> uv;
@Pikachuxxxx
Pikachuxxxx / IcoSphere.cpp
Created December 30, 2020 10:46
Script to generate IcoSphere VertexData
std::vector<glm::vec3> GenerateIcoSphereVertices(int radius, std::vector<unsigned int>& Indices, int subDivisions /*= 1*/)
{
const float S_STEP = 186 / 2048.0f; // horizontal texture step
const float T_STEP = 322 / 1024.0f; // vertical texture step
const float H_ANGLE = M_PI / 180.0f * 72; // 72 degree = 360 / 5
const float V_ANGLE = atanf(1.0f / 2); // elevation = 26.565 degrees
std::vector<float> baseVertices(12 * 3); // array of 12 vertices (x,y,z)
int i1, i2; // indices
float z,xy; // vertices
@Pikachuxxxx
Pikachuxxxx / Shader.hpp
Created October 25, 2020 10:20
OpenGL Vertex and Fragment Shader Loader and Manager
#ifndef SHADER_H
#define SHADER_H
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#define GLEW_STATIC
#include <GL/glew.h>
@Pikachuxxxx
Pikachuxxxx / FireworksGameTemplate.cpp
Created September 17, 2020 05:33
A simple snippet of example game initialisation for Fireworks Engine
#include <fireworks/fireworks.h>
using namespace fireworks;
class ExampleTemplate : public Fireworks
{
private:
Window* window;
public:
ExampleTemplate()