Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi.

I'm trying to make it so that when given 2 positions in the world (BlockPos), as well as 2 colours, I can draw a line between the 2 points with a gradient.

I know you can draw faces with the Tessellator, but I'm looking for something like this (Xycraft, where there are no visible faces):

LTBs2iP.jpg

Thanks :)

Well, you're still going to be drawing quads in all likelihood.  Just that you need a texture on those quads to give you the gradient.  You're not going to get the gradient effect without the texture (or a hell of a lot of work).

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.

  • Author

Well, you're still going to be drawing quads in all likelihood.  Just that you need a texture on those quads to give you the gradient.  You're not going to get the gradient effect without the texture (or a hell of a lot of work).

 

I guess I could draw a thin cuboid, however I kinda wanted a way to dynamically change the colour of the gradient dynamically (Interpolation). Do you know of any way to do that (eg, is there a way to use a procedurally generated texture?)

 

Also the glow in the screenshot is quite nice. Does anyone have any idea how to implement that?

I dont know much about opengl, though Im pretty sure you can apply colors to anything with a bunch of extra effects. I remeber seeing a ton of starter tutorials about how to use opengl, sampling a simple triangle in 3 different colors (each corner another color), with a nice blend effect.

 

So why not give it a try and google for some opengl java tutorials? Im sure youll find what you are looking for!

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

The colorization just means you need a white png that acts as the gradient, and then you use gl_Color to give it a color.

 

And drawing a thin cuboid is going to be just as hard as drawing a single quad: you still need the 4 important corners.

 

This might help with finding the quads.

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.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.