OPENGL A white triangle inverted above another white triangle so their tips meet form an hourglass shape

I am coding a white triangle inverted above another white triangle so their tips meet to form an hourglass shape. I need help fixing my code.

your text#include “SceneManager.h”
your text#ifndef STB_IMAGE_IMPLEMENTATION
your text#define STB_IMAGE_IMPLEMENTATION
your text#include “stb_image.h”
your text#endif

your text#include <glm/gtx/transform.hpp>

your text{
your textconst char* g_ModelName = “model”;
your textconst char* g_ColorValueName = “objectColor”;
your textconst char* g_TextureValueName = “objectTexture”;
your textconst char* g_UseTextureName = “bUseTexture”;
your textconst char* g_UseLightingName = “bUseLighting”;
your text}

your textSceneManager::SceneManager(ShaderManager *pShaderManager)
your text{
your textm_pShaderManager = pShaderManager;
your textm_basicMeshes = new ShapeMeshes();
your text}

your textSceneManager::~SceneManager()
your text{
your textm_pShaderManager = NULL;
your textdelete m_basicMeshes;
your textm_basicMeshes = NULL;
your text}

your textvoid SceneManager::SetTransformations(
your textglm::vec3 scaleXYZ,
your textfloat XrotationDegrees,
your textfloat YrotationDegrees,
your textfloat ZrotationDegrees,
your textglm::vec3 positionXYZ)
your text{
your text// variables for this method
your textglm::mat4 modelView;
your textglm::mat4 scale;
your textglm::mat4 rotationX;
your textglm::mat4 rotationY;
your textglm::mat4 rotationZ;
your textglm::mat4 translation;
your text// set the scale value in the transform buffer
your textscale = glm::scale(scaleXYZ);
your text// set the rotation values in the transform buffer
your textrotationX = glm::rotate(glm::radians(XrotationDegrees), glm::vec3(1.0f, 0.0f, 0.0f));
your textrotationY = glm::rotate(glm::radians(YrotationDegrees), glm::vec3(0.0f, 1.0f, 0.0f));
your textrotationZ = glm::rotate(glm::radians(ZrotationDegrees), glm::vec3(0.0f, 0.0f, 1.0f));
your text// set the translation value in the transform buffer
your texttranslation = glm::translate(positionXYZ);

your text// matrix math to calculate the final model matrix
your textmodelView = translation * rotationX * rotationY * rotationZ * scale;

your textif (NULL != m_pShaderManager)
your text{
your text// pass the model matrix into the shader
your textm_pShaderManager->setMat4Value(g_ModelName, modelView);
} your text`}

your textvoid SceneManager::SetShaderColor(
your textfloat redColorValue,
your textfloat greenColorValue,
your textfloat blueColorValue,
your textfloat alphaValue)
your text{
your text// variables for this method
your textglm::vec4 currentColor;

your textcurrentColor.r = redColorValue;
your textcurrentColor.g = greenColorValue;
your textcurrentColor.b = blueColorValue;
your textcurrentColor.a = alphaValue;

your textif (NULL != m_pShaderManager)
your text{
your text// set the color values into the shader
your textm_pShaderManager->setIntValue(g_UseTextureName, false);
your textm_pShaderManager->setVec4Value(g_ColorValueName, currentColor);
your text}
your text}

your textvoid SceneManager::PrepareScene()
your text{
your text// only one instance of a particular mesh needs to be
your text// loaded in memory no matter how many times it is drawn
your text// in the rendered 3D scene

your textm_basicMeshes->LoadPyramid4Mesh();
your text}

your textvoid SceneManager::RenderScene() {
your text// Set up the first pyramid transformations
your textglPushMatrix(); // Save the current matrix
your text// Apply transformations to the first pyramid
your textglTranslatef(0.0f, 1.0f, 0.0f); // Move it up so the tips meet
your text// Code to render the first pyramid
your textRenderPyramid();
your textglPopMatrix(); // Restore the saved matrix

your text// Set up the second pyramid transformations
your textglPushMatrix(); // Save the current matrix
your text// Apply transformations to the second pyramid
your textglRotatef(180.0f, 1.0f, 0.0f, 0.0f); // Invert the pyramid by rotating 180 degrees on your textthe X-axis
your textglTranslatef(0.0f, -1.0f, 0.0f); // Move it down so the tips meet
your text// Code to render the second pyramid
your textRenderPyramid();
your textglPopMatrix(); // Restore the saved matrix
your text}
Please ignore the “your text” as I had to do that in order to post my code

New contributor

Sydney Porter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật