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

Hello forums,

I've recently been into rendering. I wanted to have some fun with the tessellator and rendering random 3D shapes, like this triangular prism:

a179217835.jpg

I currently have the two slanted sides, and the two triangular bits rendering. I want to know how to figure out what 'direction' a group of vertices faces. For example, this code renders the image below:

tessellator.addVertexWithUV(0.0F, 0, 0, 1, 0);
tessellator.addVertexWithUV(0.5F, 1, 0, 1, 1);
tessellator.addVertexWithUV(1.0F, 0, 0, 0, 0);
tessellator.addVertexWithUV(0.5F, 0, 0, 0, 1);

 

bdd2ac7674.jpg

But, by simply changing a couple of numbers(i.e. the first parameter) and switching some around, I can make it face the opposite direction. What about the new code makes it so that it faces another direction? I only have about 2 days worth of experience on this topic, so sorry if the answer is obvious. Any help is appreciated.

 

EDIT: TheGreyGhost saves the day, once again. Thank you! <3

* The order of the vertices is important!  If you are looking at a face, the coordinates must be given in an anticlockwise order.  Otherwise, the face will be pointing in the wrong direction.

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.