Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/01/17 in all areas

  1. Pretty much something like that, yea. The particular implementation is up to you
    1 point
  2. I don't think you have fixed it as it is still clearly following the player with some of it's vertices. You should really use the RenderLivingEvent to not suffer with translations that much as it already has everything figured, you would just use the X/Y/Z it provides. VertexFormat is a way to tell OpenGL what data do your vertices carry. Like position. Or color. Or texture coordinates. When you start drawing with Tessellator's VertexBuffer you specify the format - the way vertices are packed. You should then follow that format when declaring your vertices. If your format is POSITION_TEX which is basically position followed by texture coordinates your vertices should include both (pos(xyz).tex(uv)). If you are not planning to use texture coordinates don't use the format which includes them. There is a POSITION format which only requires position. Or POSITION_COLOR.
    1 point
  3. Yes, you need to specify your AABB correctly. With appropriate XYZ coordinates. Something like (posX - 0.5, posY, posZ - 0.5, posX + 0.5, posY + offsetY, posZ + 0.5) Your vertexformat is position + texture coordinates yet you are only providing the position to your vertex. Why does your format even include texture coordinates if you are disabling the texture units with OpenGL in the first place? Also you do not need to call draw every n vertices. You can upload all your vertices first and then call the draw method.
    1 point
  4. How will the multiblock look like? Will the controller, input valve & output valve have specific places where they have to be, or can they be located anywhere in the 5³? I presume the tank is going to be empty, yes? Have your tank, tick every ~20 ticks (1 second) and if the multiblock has not yet been formed, scan for the nearest corner block. A corner is very important in an equilateral cube. A corner is defined as having exactly 3 wanted blocks, 1 on each axis. Once you have found your corner, you can get the opposite corner. You know the structure is 5³. The opposite corner will exist ±4 blocks away along the x, y & z-axis. Once you have your 2 corners, you know your structure, without knowing the structure. Scan once more, inside this 5³ cube, (Using BlockPos#getAllInBox) and skip over any blocks "inside" your tank, only going along the outer layer. If you encounter 1 input valve, and 1 output valve, and all other blocks consist of the tank-blocks, woohoo, we know the tank is complete! As for models: JSON models can not extend outside the "blockspace", though the model itself can be translated along any axis. This means that you will not be able to use a normal JSON for this. You can use a TESR, but over-use, and non-optimized, will kill FPS. You can start with a TESR; but I would recommend that you at least eventually make use of a custom IBakedModel, with the List<BakedQuad> scaled to fit the 5³. Custom IBakedModels take a bit to get comfortable with, but once you do, they are very easy. For fluids, you can look at Tinkers' Construct, but I would also recommend that you view Vazkii's Botania mod. The manapools render themselves through a JSON, but the mana inside is rendered with a TESR, and are optimized.
    1 point
  5. It is the event instance that the rendering is done at. Also that is a code example, you might need to tweak it before it starts working as you want it to work.
    1 point
  6. I believe I have already solved a very similar issue today
    1 point
  7. Depends. RenderManager still has those fields, they are just private. But I think that you want to use the viewerPosX/Y/Z ones. They require the RenderManager instance though. You might want to look at EntityRenderer and the way it handles player-camera-based transformations, if I understood your intentions correctly. What do you want to achieve? AxisAlignedBB can simply be instantiated (new AxisAlignedBB(x0, y0, z0, x1, y1, z1)). It changed a bit though(it's xyz fields are now final and it has a few new methods) so you might want to see how vanilla handles it now.
    1 point
  8. Show your code? The following line works just fine for me: Tessellator.getInstance().getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); Have you added GL11 to your imports? In any case you do not need to reference GL at all. GL_QUADS is a constant of 7. So Tessellator.getInstance().getBuffer().begin(7, DefaultVertexFormats.POSITION_TEX); Will work exactly the same, just look slightly more messy with that 7 out of nowhere
    1 point
  9. draw still exists, it is just not in the VertexBuffer, but in the Tessellator itself: Tessellator.getInstance().draw()
    1 point
  10. it is now called begin, and takes an integer and a VertexFormat as parameters. Integer is just the drawing method, the way your vertices are drawn by OpenGL. You can reference GL directly(for rendering quads you would use GL11.GL_QUADS, or for something more complex you can use other drawing indices). VertexFormat is the way your vertices are packet and uploaded to OpenGL. While you can define your own format there is no need to do so as all of them can be found in the DefaultVertexFormats class. Their names are pretty self-explanatory
    1 point
  11. You are. The formats have changed to work with GL >=3.0 startDrawingQuads -> begin, now needs a format to be specified for vertices. addVertex -> pos(x, y, z).tex(u, v).color(r, g, b, a).normal(x, y, z).lightmap(s, t).endVertex(). Note that the chaining will be different for the format you choose. If your format is POSITION_TEX you will only have pos(...).tex(...).endVertex() draw is still draw. Look at the way vanilla works with tessellator now in vanilla code. GUIs are a good example as they usually manipulate tessellator directly
    1 point
  12. Ok, now I officially use freedns.afraid.org, it works fine too. Don't even need to renew it!
    1 point
  13. You got an issue of brief Client-Server mis-match Server: Didn't allow the thing. -Your code did this Client: Allowed the thing. -Running as usual Server: No you didn't. -Client updates with data from Server Solution: Remove the World#isRemote check
    1 point
×
×
  • Create New...

Important Information

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