Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi Sorry dude, all that old hard-coded rendering stuff was torn up and thrown in the bin. The block rendering is now completely different and the methods you're looking for probably don't exist. Some info here http://greyminecraftcoder.blogspot.com.au/2014/12/block-rendering-18.html and http://greyminecraftcoder.blogspot.com.au/2014/12/block-models-18.html -TGG
  2. Hi A lot of necessary stuff is missing from your code. This tutorial project has an example of blocks which can be placed facing different directions https://github.com/TheGreyGhost/MinecraftByExample (see MBE03) -TGG
  3. Hi Adam To the best of my knowledge there really is no magic fix for this, using a small offset is the only robust way to solve it. You can make the offset very small so any seam should be unnoticeable; alternatively in the example you showed, it should be possible to offset one of the faces forward without visible seams at the block edges. -TGG
  4. Keen, nice work When I get a spare few hours I might try looking at IPerspectiveAware to see what the problem is. Could be a bug perhaps. -TGG
  5. Hi Looks like your rendering methods are messing with one of the rendering settings. There are quite a few of them. You could try using GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); .. your render stuff here... GL11.glPopAttrib(); or GL11.glPushAttrib(GL11.GL_ENABLE_BIT); .. your render stuff here... GL11.glPopAttrib(); glPushMatrix only stores the transformation matrix, glPushAttrib can be used to save rendering settings too Failing that, I'd suggest you narrow it down as much as possible and then look to see exactly which vanilla code is changing rendering settings. I don't think it's likely to be texture binding. The day/night suggests you have turned world lighting on somehow. The glPushAttrib should fix that. -TGG
  6. Hi /** // Creates a baked quad for the given face. // When you are directly looking at the face, the quad is centred at [centreLR, centreUD] // The left<->right "width" of the face is width, the bottom<-->top "height" is height. // The amount that the quad is displaced towards the viewer i.e. (perpendicular to the flat face you can see) is forwardDisplacement // - for example, for an EAST face, a value of 0.00 lies directly on the EAST face of the cube. a value of 0.01 lies // slightly to the east of the EAST face (at x=1.01). a value of -0.01 lies slightly to the west of the EAST face (at x=0.99). // The orientation of the faces is as per the diagram on this page // http://greyminecraftcoder.blogspot.com.au/2014/12/block-models-texturing-quads-faces.html // Read this page to learn more about how to draw a textured quad // http://greyminecraftcoder.blogspot.co.at/2014/12/the-tessellator-and-worldrenderer-18.html -TGG
  7. no problem you're welcome -TGG
  8. Hi This link has a lot more info on block models http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html (see the Blocks sections) also this tutorial project has a section showing how to generate BakedQuads https://github.com/TheGreyGhost/MinecraftByExample specifically https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe15_item_smartitemmodel/ChessboardSmartItemModel.java -TGG
  9. @ernio by crikey dude, where do you get all these pics from, they're priceless! @Failender ouch, truth. But dieSieben had matters well in hand. Anyone can debug a program on their own PC, but it takes a dieSieben to debug by proxy over a connection with such low SNR (no offence Morpheus ) -TGG
  10. Hi Forge is full of pitfalls like that unfortunately. Like - if your client needs a copy of the field, you also need to implement packets for your TileEntity as well. eg see here http://greyminecraftcoder.blogspot.com.au/2015/01/tileentity.html -TGG
  11. Hi Keen, getting there. The field doesn't need to be global (static), it can be an ordinary member variable. Ah. Items dropped on the ground don't use any transform at all so they never call IPerspectiveAwareModel. I don't see them calling ISmartItemModel either. I suggest you should add some System.out.println to your methods to check if that's true. If so, you should refactor your code to 1) your initial model "A" should look like the dropped item. 2) if ISmartItemModel is called on your initial model "A", return a different model "B" with the itemstack information in it 3) when IPerspectiveAwareModel is called on "B", save the perspective info in "B" and return it again That way, EntityItem renders using model A All other views render using model B with the saved perspective info. -TGG
  12. ROFL this thread is hilarious -TGG
  13. Hi For background info it might help to find an online introductory course into vector maths, just the simple stuff like adding & subtracting vectors, length, multiplying by a length, calculating angles between them, that sort of thing. A lot of minecraft stuff is based on vectors... The short answer is- deltaVector = targetPositionVector - originPositionVector targetVector is the entity being looked at. for example Entity1 = origin = located at [5, 4, 3] Entity2 = target (being looked at) = located at [10, 11, 1] the vector pointed from Entity1 toward Entity2 is [10-5, 11-4, 1-3] = [5, 7, -2] -TGG
  14. Hi http://greyminecraftcoder.blogspot.com.au/2015/07/entity-rotations-and-animation.html But System.out.println as Failender says is probably the fastest way to figure it out... Depending on what you want to do, EntityLivingBase.getLookVec() might be useful. -TGG
  15. Hi where do you call this code? should be in the init() phase, in your common proxy Are you sure blockslowsilver isn't null at the point you call this method? -TGG
  16. Hi I suggest- @Override public Pair<IBakedModel, Matrix4f> handlePerspective(TransformType transformType) { myRememberedTransformType = transformType); // field in this switch (transformType) { case FIRST_PERSON: return Pair.of(this, ForgeHooksClient.getMatrix(this.baseModel.getItemCameraTransforms().firstPerson)); case THIRD_PERSON: return Pair.of(this, ForgeHooksClient.getMatrix(this.baseModel.getItemCameraTransforms().thirdPerson)); case GUI: return Pair.of(this, ForgeHooksClient.getMatrix(this.baseModel.getItemCameraTransforms().gui)); case HEAD: return Pair.of(this, ForgeHooksClient.getMatrix(this.baseModel.getItemCameraTransforms().head)); default: return null; } } and then public List getFaceQuads(EnumFacing enumFacing) { List<BakedQuad> combined = new ArrayList<BakedQuad>(this.baseModel.getFaceQuads(enumFacing)); if (myRememberTransformType == FIRST_PERSON) { // retrieve the remembered value here combined.addAll(this.mergeModel.getFaceQuads(enumFacing)); } return combined; } -TGG
  17. Hi Probably your rendering is changing the opengl graphics flags or perhaps changing the bound texture. Changing the time (event) that you render the element might help; you might also be able to save/restore the settings, or to call a vanilla method to set the rendering settings back. I think the best way to track this down is to set a breakpoint in your hud render code, see where it's being called from, then try to figure out which rendering settings your code is messing with. The forge code just before calling your render code, and just after, might also give you clues. -TGG
  18. Hi You might find this tutorial project useful (MBE03) https://github.com/TheGreyGhost/MinecraftByExample Also perhaps this troubleshooting guide http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html -TGG
  19. Hi The method you're using for combing faceQuads and generalQuads looks good; I think all you need to do is use your saved perspective (first person, third person, gui) from the IPerspectiveAwareModel code, in place of the .thirdPersonView. (And fix the rotation change caused by Forge's Matrix4f transformation). This will let you handle all three cases properly. TGG
  20. > idea.module.inheritOutputDirs = true Will this cause problems if the project is later compiled in Eclipse? -TGG
  21. Hi it's related to alpha blending (transparencies). To figure it out: 1) GLstateManager.blendFunc shows GL11.glBlendFunc and a quick search in GL11 for the hexadecimal format of 770 and 771 (0x302 and 0x303) gives GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA i.e. GL11.glBlendFunc(GR_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); more info in this chapter http://www.glprogramming.com/red/chapter06.html -TGG
  22. > I would consult this handy reference guide, wrung from the vanilla code with much sweat, anguish and cursing: http://greyminecraftcoder.blogspot.ch/2015/01/mining-blocks-with-tools.html and http://greyminecraftcoder.blogspot.ch/2015/01/summary-of-logic-flow-when-mining-blocks.html but actually I think cancelling PlayerInteractEvent(LEFT_CLICK_BLOCK) should have worked. Cancelling BlockEvent.BreakEvent should also have worked. At least, it did in my testing. You might be suffering some sort of client-server synchronisation problem - is your code executing on both sides? One of the examples in this example project can be used to hook in to all the various block mining events, might help track it down. https://github.com/TheGreyGhost/MinecraftByExample (MBE13) -TGG
  23. >Can someone explain why the new, odd rotation is added to the item model? Sorry dude, I have no experience with that. You might need to resort to inspecting your Matrix4f, comparing it to the vanilla transform, and seeing what's different. That will be tricky. -TGG
  24. Hi Use a TileEntitySpecialRenderer this tutorial project might help (MBE21) https://github.com/TheGreyGhost/MinecraftByExample -TGG
  25. Hi it's similar, but there's a critical difference (unless I've misunderstood your code) In MBE14, it has the base model and a wrapper model which has the base model inside it. when wrapper.handlePerspective() is called, it then calls basemodel.handlePerspective() to get the perspective matrix from the base model. wrapper.handlePerspective() doesn't call wrapper.handlePerspective(), which is what I think your code is doing? And also, the cast from basemodel to (IPerspectiveAwareModel)basemodel is only possible because the code has previously checked if basemodel implements IPerspectiveAwareModel. That's not true in your case? -TGG
×
×
  • Create New...

Important Information

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