Skip to content

A tool to make a file of image base64 data for textures.

Notifications You must be signed in to change notification settings

tomand285/imgToTexture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

makeTextures.js

This is a Node.js program designed to create a file to hold the base64 data of images intended to be used with webGL.

What is this repository for?

I created this for CS 559 Computer Graphics at UW - Madison as a way to help me auto create a file of textures. The output format is based off of this tool.

How do I get set up?

  • You must have Node.js downloaded onto your computer in order for this program to run.
  • Either copy or download makeTextures.js and run using Node.js.
  • Save a copy of this program in the directory of your textures and run via the terminal:
node maketextures.js
  • The new file will be called: textures.js

How to use textures.js in your program?

  • In html file:
<script src="textureFolder/textures.js"></script>
  • In the texture part of your code:
var image = new Image();
image.crossOrigin = "anonymous";
image.src = LoadedImageFiles["myTexture.jpg"];
image.onload = function(){
	//TODO: add texture code here
}

Contribution guidelines

  • If you would like to make edits, please create a pull request or make an new issue.

Who do I talk to?

About

A tool to make a file of image base64 data for textures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published