Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8076229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:13:17+00:00 2026-06-05T15:13:17+00:00

I am having issues creating a simple 2D scene with Three.js. I would like

  • 0

I am having issues creating a simple 2D scene with Three.js. I would like to create a 2D view on a colored triangle. I am not able to make the triangle colored (eg. red). I believe that I will need the following for that:

  • THREE.OrthographicCamera
  • simple triangle -> i.e. THREE.Geometry() colored in red

I do not want any shadows, just a simple red 2D triangle in the orthographic scene.Any suggestions on how to make it are welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:13:18+00:00Added an answer on June 5, 2026 at 3:13 pm

    If you are going to use the base Geometry class you need to add all your own vertices to the scene. You can do this with the Vertex class like so

    var geometry = new THREE.Geometry();
    var v1 = new THREE.Vector3(0,0,0);   // Vector3 used to specify position
    var v2 = new THREE.Vector3(1,0,0);
    var v3 = new THREE.Vector3(0,1,0);   // 2d = all vertices in the same plane.. z = 0
    
    // add new geometry based on the specified positions
    geometry.vertices.push(v1);
    geometry.vertices.push(v2);
    geometry.vertices.push(v3);
    

    We then need to construct a face from our vertices, you pass in the indices of the vertices in the order they are pushed above..

    [EDIT]: As mrdoob points out below, you also need to add them in counter clock-wise order.

    enter image description here

    This was the problem with my fiddle. You can view the fixed demo here.

    geometry.faces.push(new THREE.Face3(0, 2, 1));
    

    Finally create a material and combine it with your geometry to create a Mesh. Even for 2D I believe you are required to create a mesh in order to display this.

    var redMat = new THREE.MeshBasicMaterial({color: 0xff0000});
    var triangle = new THREE.Mesh(geometry, redMat);
    scene.add(triangle)                               // added at the origin
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having some issues creating a macro >.>.. And would like to request
I'm having issues creating a simple join table (associative table, etc. whatever your flavor
I am just creating simple HTML website for class. I am having issues with
Im having issues getting this to work, maybe its not even possible? I have
The code is below but I am having some issues with creating a relative
I'm creating a simple GUI app using Tkinter with Python, but I'm having problems
Okay. I'm having some conceptual issues with a WCF service i want to create.
Good Day, I'm having few issues with Doctrine entities generator while creating new project
I'm having issues creating an ActionLink using Preview 5. All the docs I can
I am having issues with creating a space between the bottom of the screen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.