Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
7Roses

holographic extended api

Recommended Posts

I present you my first version of a hologram api.

so first of all, yes I know the hologram already has an component api well documented. but I extended a bit upon this.

First and for all, I found the 48*48*32 voxels a bit low... so thats what this api does.

it will give you the option to combine 2,3,4,n hologram projectors and access them as if it where one.

so how to use this api?

just download the files and save them on your pc. github link to files (you only need the /usr/lib/hpu.lua for the basic functionality)

then add the next requirement to your script in need of a bigger hologram:

-- just add this to your script
local hpu = require("hpu");

-- now you can 'bind' the holograms to this api:
holo =  component.proxy(component.get(<your short address>));
hpu.bind(holo,1,1,1);-- first your hologram proxy, next your starting x,y,z positions.

-- and then your second hologram
holo = component.proxy(component.get(<your short address>));
hpu.bind(holo,49,1,1);
  
-- and now your free to use the functions to your content:
hpu.set(60,1,1,1)-- this will set the needed voxel on the second configured hologram.

Be ware, while it is already functioning, some api functions of hologram where not yet implemented, but they will come in the coming days. (as fast as I can get some free time to code them)

functions working: set,get

 

also for those who wanted some extended drawing features for holograms, on the same github page there is also an hpudraw.lua file, this is an api that builds upon this api, and gives you the possibility to draw a line between 2 points. (maybe later other features as well)

 

for those who want to see what's possible, and cause everyone wants pictures:

 

multihologram.jpg

Link to post
Share on other sites

at the moment you can, although its not yet supposed to work that way.

but the current workaround to get that is to configure them as if it where a 48*4 x 48 x 32 space, but use the translation functions on the separate holograms to overlap the regions

that way you just need to remember to use certain voxel ranges for certain colors :) (1->48 as 3 colors, 49->96 as another 3, 97->... )

but that's a bit of a difficult thing to do :/ so maybe a later version will give you a much easier way to get what you just asked.

but currently I'm still working on the fill and copy functions, as well as a small drawing api (for easier line and other form drawing, cause drawing with vertical lines and points is so tiresome)

Link to post
Share on other sites
changelog:
- implemented hpu.fill() function *same as the hologram api, but for multiholo*
- implemented hpudraw.vertex(point1,point2,point3,value) -- with points a table {x=,y=,z=}
- implemented some more vector math functions in the vector module.

sorry no pictures of the new features, can't find out how to add a picture in 0.02MB :-/

 

EDIT: cause I don't want to post twice in a row:

version 0.3 is ready!!

changelog:
==Changes:
- hpu.bind(hologramProxy,x,y,z) now can be called with an additional colorPalet table.
  hpu.bind(hologramProxy,x,y,z,palette) where palette would be something like {1,3,5} -> this means the colorPalet index 1,3,5 will work for this hologram.
  on binding it will overwrite the hpu.palette colors with the hologramProxy's already configured colors.
- hpu.get(x,y,z) will now return a table of found voxels -> this so that if multiple holograms act on the same x,y,z position you get all there results back.

==bug fixes
- fixed a memory leaky bug where running the same program where hpu.bind was used on a already bound hpu would register it a second time.

==Additions:
- hpu.setPaletteColor(index,color) this way you can set a color for an index, it also will push this color to all the bound holograms that are registered for this indexed color.
- hpu.getPaletteColor(index) just to get the color configured in the hpu global palette
- hpu.initColors() if you have changed the colors directly on the hologramproxy, but want to reset them to the configured hpu.palette, this also will be called on a setPaletteColor of the hpu.
- hpu.setModeMultiColor(boolean) this will make it so that any hologram will first try to unset the voxel on the specific 3dpoint on hpu.set, this makes that only holograms with the chosen color will act, and no overlap will be visible on the hologram. (if you want to mix voxels and so make multiple colors just don't enable this and you can mix them to make colors by using 2 different voxels on the same position.)
- hpu.version => just for organising my changelogs

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.