Jump to content

[1.7.2] [SOLVED] Fun with Tessellator and Vertices :)


RSQ

Recommended Posts

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.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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