YesImAHuman Posted June 23, 2017 Share Posted June 23, 2017 (edited) hi, im creating a mod and i just recently started modding, so im just gonna ask quickly, how do i render a line between 2 points? Edited June 23, 2017 by YesImAHuman Quote Link to comment Share on other sites More sharing options...
Matryoshika Posted June 23, 2017 Share Posted June 23, 2017 well, that depends. Are we talking drawing a line in 3D space (from block/entity->block/entity) or are we talking 2D (within a GUI)? Quote Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials. Link to comment Share on other sites More sharing options...
Draco18s Posted June 23, 2017 Share Posted June 23, 2017 Some conversion needs to be done to update this to 1.10 (Tessellator got renamed and some of the methods refactored, but I was able to update those in another place fairly easily; this code never got ported), but here's how I drew a line between two blocks https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hazards/client/HazardsClientEventHandler.java#L371 Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
YesImAHuman Posted June 23, 2017 Author Share Posted June 23, 2017 4 hours ago, Matryoshika said: well, that depends. Are we talking drawing a line in 3D space (from block/entity->block/entity) or are we talking 2D (within a GUI)? in a 3D space, location to location Quote Link to comment Share on other sites More sharing options...
Kokkie Posted June 23, 2017 Share Posted June 23, 2017 Where do you need this for? Quote Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod Link to comment Share on other sites More sharing options...
YesImAHuman Posted June 23, 2017 Author Share Posted June 23, 2017 (edited) 20 minutes ago, Kokkie said: Where do you need this for? im trying to make a kind of laser weapon Edited June 23, 2017 by YesImAHuman Quote Link to comment Share on other sites More sharing options...
Kokkie Posted June 23, 2017 Share Posted June 23, 2017 Ah ok, I thought it might have been for a cheat which aren't supported here. Just making sure Quote Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod Link to comment Share on other sites More sharing options...
YesImAHuman Posted June 23, 2017 Author Share Posted June 23, 2017 oh @Kokkie i just noticed that youre dutch aswell (atleast i think so because of your Github Repo) Quote Link to comment Share on other sites More sharing options...
YesImAHuman Posted June 23, 2017 Author Share Posted June 23, 2017 4 hours ago, Draco18s said: Some conversion needs to be done to update this to 1.10 (Tessellator got renamed and some of the methods refactored, but I was able to update those in another place fairly easily; this code never got ported), but here's how I drew a line between two blocks https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hazards/client/HazardsClientEventHandler.java#L371 i tried using it and fixing the errors, but ive never tried anything with OpenGL, so it created some errors This is what the code it now: https://pastebin.com/ayFFV06m and it gives an error at line 10: tess.begin(7, new VertexFormat()); and i think it would probably make some more errors with the code using the Tessellator Quote Link to comment Share on other sites More sharing options...
Draco18s Posted June 23, 2017 Share Posted June 23, 2017 (edited) I believe that got replaces with something like .startDrawingQuads(), though I can't remember what I was even working on that I had to update some tessellator code. Find some other examples (eg vanilla usage) and see what they do. Edited June 23, 2017 by Draco18s Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
YesImAHuman Posted June 23, 2017 Author Share Posted June 23, 2017 @Draco18s nope, cant see anything closely like it except .finishDrawing() (a void) and .getDrawingMode() (returns an int) Quote Link to comment Share on other sites More sharing options...
YesImAHuman Posted June 23, 2017 Author Share Posted June 23, 2017 ive looked in the vanilla classes, i did it wrong with the VertexFormat Quote Link to comment Share on other sites More sharing options...
YesImAHuman Posted June 23, 2017 Author Share Posted June 23, 2017 it kinda works... it doesnt create any errors, but it also doesnt create any lines... Quote Link to comment Share on other sites More sharing options...
Kokkie Posted June 23, 2017 Share Posted June 23, 2017 (edited) Show your code. Edited June 23, 2017 by Kokkie Quote Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod Link to comment Share on other sites More sharing options...
YesImAHuman Posted June 25, 2017 Author Share Posted June 25, 2017 https://pastebin.com/ETF51ewR Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.