C++ :: Designing Object In Solidworks -> OpenGL?

Jul 11, 2014

If I wanted to design an object in SolidWorks, and then output that object (I guess as a .stl file), is it possible to open that up and manipulate using openGL? How would I go about doing that?

View 1 Replies


ADVERTISEMENT

C/C++ :: Automatic Cast Object To OpenGL Handle / ID

Oct 24, 2014

I programming currently something with OpenGL. Now I have written some wrapper classes, like Shader, Program .... All works fine, but I don't like to call Shader.GetHandle() every time I want to call a OpenGL function manually where I need the object handle/id. (GetHandle() returns the OpenGL ID of the object)

So now I wonder, is it possible to program it in C++ so, that I can put my objects to gl methods and c++ automatically pass the handle/id member to that function ? Is there maybe a operator that I can use for that?

For example:

The way I do it now:

Shader vertexShader();
glCompileShader(vertexShader.GetHandle());

The way I want to:

Shader vertexShader;
glCompileShader(vertexShader);

View 3 Replies View Related

C++ :: OpenGL - Does Vertex Array Object Store Enabled Attributes

Jan 8, 2014

Does the VAO (glGenVertexArrays/glBindVertexArray/glDeleteVertexArrays) store the enabled/disabled state for the Vertex Attributes (glEnableVertexAttribArray/glDisableVertexAttribArray) or should I re-enable them every time?

View 1 Replies View Related

C++ :: Bool Algebra - Designing Database Query

May 15, 2012

I am designing a database query and need simplification to the algebra:

Code:
((x > u) && (x < y)) || ((z > u) && (z < y)) || ((u > z) && (y < x))

And these are always true:

Code:
z > x
u > y

It's a range overlap algorithm.

View 4 Replies View Related

Managed C++ And C++/CLI :: Designing GUI - Ambiguous Symbol String Used

Jan 10, 2014

I am working on my project of gesture recognition using c++ and open cv and i am also designing GUI simultaneously. I am using system namespace for GUI part and cv namespace for gestures.

After compiling i am getting error as Ambiguous symbol String is used.

This the link for msdn error support : [URL] .....

View 5 Replies View Related

C++ :: Develop Month Calendar By Designing A Class - Inheritance And Composition

Nov 10, 2014

In this assignment the student should develop a month calendar by designing a class called calendarType . This class uses two other classes (dateType and dayType) as described below:

1. dayType Class: This class has been designed by students in Lab1 exercises. Referee to it.
2. dateType Class: This class is designed and implemented to keep track of data. This class has been provided it to you. Study it first then add definitions and implementations of the following operations to this class:

- Test whether the year is a leap year. Leap year is identified by 3 criteria :
- The year is evenly divisible by 4;
- If the year can be evenly divided by 100, it is NOT a leap year, unless;
- The year is also evenly divisible by 400. Then it is a leap year.
- Return the number of days in the month. For example, if the date is 12/3/2014, the number of days to be returned is 31 because there are 31 days in March.
- Return the number of days passed in the year. For example, if the date is 18/3/2014 the number of days passed is 77. Note that the number of days returned also includes the current day.
- Return the number of days remaining in the year. For example, if the date is
18/3/2014 , the number of days remaining in the year is 288.
- Calculate the new date by adding a fixed number of days to the date. For example, if the date is 18/3/2014 and the days to be added are 25, the new date is 12/4/2014.

To print monthly calendar using calendarType class, you must know the first day of the month and the number of the days in that month. Thus, you must store the first day of the month, which is in the form of dayType and the month and the year of the calendar. Clearly, the month and the year can be stored as an object of the form dateType by setting the day component of the date to 1, and the month and year as specified by user.

Design the class calendarType so that the program print a calendar for any month starting 1/1/ 1500 which is Monday. To calculate the first day of a month, you can add the 2 appropriate days to Monday of January 1, 1500. For this class identify and implement the following operations:

- Determine the first day of the month for which the calendar will be printed. Call this operation firstDayOfMonth.
- set/get month.
- set/get year.
- Print calendar for particular month.
- Add the appropriate constructors to initialize the member variables.
- Write a test program to print the calendar for either a particular year or a particular month.

View 1 Replies View Related

C++ :: OpenGL And 2D Games

Sep 12, 2013

How I can make 2D games in OpenGL. I have sprites, but when I load them in game, they're all big and stuff, not pixel for pixel how I'd like them. How can I do this?

View 16 Replies View Related

C++ ::  Use DirectX Or OpenGL?

Feb 6, 2014

I am because I don't know what to use OpenGL or DirectX? I heard some people saying I can use both. How is this? What is better for online games? And when I choose I will need some tutorials too ....

View 1 Replies View Related

C++ :: OpenGL - Draw On Top Of Image

Jun 22, 2014

This is my first time using opengl and I am experimenting with adding/drawing polygons/points/etc. on top of a PPM image. The image is already loaded when the application runs. My attempt to draw a square is from lines 30 - 35. The program runs but the square is not present. Just the image.

#include<windows.h>
#include <stdio.h>
#include <stdlib.h>
#include<Gl/gl.h>
#include<GL/glut.h>

int n;
int m;
int *image;

[Code] ....

View 5 Replies View Related

C++ :: How To Draw A 3D Snake In OpenGL

Jan 3, 2014

i want to draw a 3D snake in opengl.. i can't get nothing out of my search to make a start.. how it is made

View 4 Replies View Related

C++ :: Taking A Screenshot In OpenGL

Sep 14, 2013

I've read up on .bmp files on wikipedia and am currently attempting to make a function that can export a .bmp file of the screen of my programs. I've already begun work on it but it isn't working. The code I have so far is:

typedef char Byte;
typedef int Byte4;
typedef short Byte2;
struct BMP_Header {

[Code] ....

My problems are that when less then the required amount of bytes is needed to store a value in the file, the 00 bytes are skipped (Ex. The file will contain 42 instead of 42 00 00 00), and the Pixels are stored as nothing but 0D ( every value intended for storing pixel data is 0D ).

View 4 Replies View Related

C++ :: Textures White In OpenGL

Nov 17, 2013

I don't know why, but textures in OpenGL are white. One day, I must've change something, and now my textures wont load properly. I tried rewriting my code that loads things multiple times, my textures still are white. Here is my code:

(I switched back to the FF pipeline temporarily, in my other projects I use shaders.)

Sprite.hpp

#include <SDL.h>
#include <SDL_opengl.h>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>

#ifndef _SPRITE_H_
#define _SPRITE_H_

[Code] ....

View 2 Replies View Related

C++ :: How To Make Fractals With OpenGL

Jan 20, 2013

Where can I learn how to make fractals with opengl?

View 1 Replies View Related

C/C++ :: Fix Upside-down Characters In OpenGL?

Jun 20, 2014

I'm printing characters on a texture map using OpenGL and GLUT with C++. The problem is that when they appear on the map the x-coordinates are correct but the y-coordinates are upside down. The coordinates are being read from an input file and are in the form x,y with a semicolon separating each xy pair. I tried putting a negative sign in front of the y-coordinates to see if that would force the characters to go in the right place but that just made minus signs appear on the screen. Is there a function in OpenGL/GLUT that can invert coordinates by a certain value?

View 12 Replies View Related

C++ :: How To Convert Pixel To Coordinate In OpenGL

May 23, 2013

How can i convert pixel to [-1..1]coordinate in opengl? Which function? I want to write a program that is work with

glutmousefunc(),

When I click on the screen a ball is appear on it where clicked. but mouse work with pixel and circle work with coordinate between -1 and 1 ....

View 4 Replies View Related

C++ :: Print Score In SDL With OpenGL Using Ostream?

Mar 5, 2013

I am using the following code to print in SDL screen

SDL_GL_RenderText( timer, font, color, &position);
sprintf(timer," Time : %d",time);

to print in SDL screen(used with opengl) , i am doing project on C++, as "sprintf" is C style function , so i can't do like this , i am trying to use" ostringstream" , but i am not sure how to use it.

View 1 Replies View Related

C++ :: Compile OpenGL Program In Ubuntu

Aug 15, 2014

I am trying to compile an OpenGL program in Ubuntu.This program opens a blank window.

Code:

#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <cstdio>
#include <iostream>
int main(int argc,char* argv[])

[code]....

View 6 Replies View Related

C++ :: Create 3D Game Engine With OpenGL?

Jul 19, 2013

What i'm trying to do is create a 3d game engine with opengl and i want to be multi platform. I'm trying to use code-blocks for this reason but i'm having trouble setting up opengl for code-blocks

View 1 Replies View Related

C++ :: GLSL Heightmap Coloring (OpenGL)

Aug 27, 2013

I recently made a heightmap, it uses a triangle strip /row, and I try to figure out how can i color the triangles one by one. So, for example I have a color array of 9:

[0.0f,0.2f,0.6f //a triangles first vertex
0.0f,0.4f,0.3f //second vertex
0.0f,0.7f,0.2f] //third vertex

And I want to use it to color all triangles with it. My heightmap coords are in a vector:

vector<GLfloat> hmapcrds [x1,h1,z1; x2,h2,z2;...]

Like this:

c1 c2 c3 c4 c5 //row 1
c6 c7 c8 c9 c10 //row 2 coordinates

index array:c6->c1->c7->c2 ...cn->c(n-rwosize)->c(n+1)->cn->c(n-rwosize+1)

I draw my elements with a VAO and drawelements/row; (i tried drawrange but didnt work)
...
glGenVertexArrays(1,&VertArrObj);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,indexBuffer);
glBufferData(GL_ELEMENT_ARRAY_BUFFER,sizeof(GLuint)*v_heightIndexes.sie(),&v_heightIndexes[0],GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER,vertexBuffer);

[Code] ....

I think it want to index my color array too, so how can i do that it only reads the 3 colors from my array, the repeat it /vertex/triangle till the end of drawing.

The shaders work fine, i changed the map to a triangle so it applied these colors, but with the map "I see only darkness before me".

with my working shader without color "in" - height coloring: [URL] ....

(I also want to do texturing per triangle.)

View 2 Replies View Related

C++ :: OpenGL Preserve States (SFML)

Feb 12, 2013

So I did read, however it said also that it was memory intensive and I had a question... I also came across this:

Window.pushGLStates();
Window.draw("Sfml Text");
Window.popGLStates();

The problem here is that none of these commands exist!

Window.draw should exist and even though I have all the proper includes I still get it telling me that 'Draw' is not a member of sf::Window

I have encountered that error many times everywhere across my sfml related code, it's not like they removed all those features in the update (Which they did not) but, why then would it not be a member?

View 8 Replies View Related

C++ ::  Drawing Rectangular Prism OpenGL

Oct 10, 2013

I am supposed to create a class of rectangular prism in opengl. I am having touble in writing my "draw()" function.

I have searched the web, and lots of the sites have:

glBegin(GL_Quads);

glVertex3f(x,y,z);
glVertex3f(...);
glVertex3f(...);
glVertex3f(...);

3D coordinates for each face.

For my code, I am getting a value for lengths of x, y and z like "getXlength(x_length)" etc... I would like to know how I can use these values to draw the prism rather than giving values for each coordinates in each face.

View 1 Replies View Related

C++ :: How To Make A Simple 3D Cube With OpenGL

Nov 26, 2013

I am using SFML CodeBlocks and OpenGL i am not very good in OGL ...

i want 2 know how to make a simple 3d Cube with OGL ...

View 1 Replies View Related

C++ :: Segmentation Fault With OpenGL Tessellation

May 4, 2013

I wrote a program in C + + and OpenGL using MinGW, which displays a map in 2D.

The following is a function that does the fault occur, ie when executes the statement gluTessEndPolygon (tobj) gives me segmentation fault:

// render each block as a polygon extruded into Z
void BlockGroup::BuildDisplayList() {
static GLUtesselator *tobj = NULL;
if( ! mod.world->IsGUI() )

[code]....

contours is a list of vectors of the following type:

std::vector<std::vector<GLdouble> > contours;

I report also:

#define VAR(V, init) __typeof(init) V=(init)
#define FOR_EACH(I,C) for(VAR(I, (C).begin()), ite = (C).end(); (I) != ite;
++(I))

I tried to use the debug and have come to the message of Segmentation Fault on education above. Now I do not know what to do.

View 2 Replies View Related

C++ :: Get OpenGL Working In Code Blocks?

Dec 28, 2013

how to get opengl working in code blocks? I have tried putting in the libraries and such in the correct folder. But I get an error saying that glut32.dll could not be found. I am running a 10.5 code blocks

View 1 Replies View Related

C++ :: OPENGL How To Load A Texture With Alpha Channel

Jun 27, 2014

I'm trying to load a Quad with a Monster Image on it that will always face the Camera, a la Doom 2.

Now I don't know how to load an image with an Alpha part on it.

In 2D using SDL I always used tga files.

Here is my LoadTexture functions.

AUX_RGBImageRec *LoadBMP(char *Filename) // Loads A Bitmap Image
{
FILE *File=NULL; // File Handle

[Code].....

View 2 Replies View Related

C/C++ :: Rendering OpenGL Inside Of Win32 Control?

Feb 22, 2015

I am trying to get OpenGL to render inside of a Win32 api static control. I've gone through Nehe's tutorial [URL] on how to render to an entire window. I understand how to do that and I can do it, but I'm not totally sure how to get it to render inside of a static control(or any control). The idea is to have a gui built around an OpenGL view. how I could render inside a static or custom win32 control?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved