• 9
• 11
• 11
• 9
• 20
• ### Similar Content

• Hello guys,

How do I know? Why does wavefront not show for me?
I already checked I have non errors yet.

And my download (mega.nz) should it is original but I tried no success...
- Add blend source and png file here I have tried tried,.....

PS: Why is our community not active? I wait very longer. Stop to lie me!
Thanks !

• I wasn't sure if this would be the right place for a topic like this so sorry if it isn't.
I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link them all together. The issue I'm having with now though is basically the planets and moons orbit correctly at their own orbit speeds.
I'm not really experienced with using matrices for stuff like this so It's likely why I can't figure out how exactly to get it working. This is where I'm applying the transformation matrices, as well as pushing and popping them. This is within the Render function that every planet including the sun and moons will have and run.
if (tag != "Sun") { glRotatef(orbitAngle, orbitRotation.X, orbitRotation.Y, orbitRotation.Z); } glPushMatrix(); glTranslatef(position.X, position.Y, position.Z); glRotatef(rotationAngle, rotation.X, rotation.Y, rotation.Z); glScalef(scale.X, scale.Y, scale.Z); glDrawElements(GL_TRIANGLES, mesh->indiceCount, GL_UNSIGNED_SHORT, mesh->indices); if (tag != "Sun") { glPopMatrix(); } The "If(tag != "Sun")" parts are my attempts are getting the planets to orbit correctly though it likely isn't the way I'm meant to be doing it. So I was wondering if someone would be able to help me? As I really don't have an idea on what I would do to get it working. Using the if statement is truthfully the closest I've got to it working but there are still weird effects like the planets orbiting faster then they should depending on the number of planets actually be updated/rendered.

• Hello everyone,
I have problem with texture

• Hello everyone
For @80bserver8 nice job - I have found Google search. How did you port from Javascript WebGL to C# OpenTK.?
I have been searched Google but it shows f***ing Unity 3D. I really want know how do I understand I want start with OpenTK But I want know where is porting of Javascript and C#?

Thanks!
• By mike44
Hi
I draw in a OpenGL framebuffer. All is fine but it eats FPS (frames per second), hence I wonder if I could execute the framebuffer drawing only every 5-10th loop or so?
Many thanks

# OpenGL From openGL to various 3D format

This topic is 992 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi everyone , i'm still working on my 3D app with openGL 2.1 ; and now i need to export files from the current scene , to various 3D format (3 to be precise) which are the following : Obj , VRML , and PLY. I need to also implement file loaders for these 3 formats (which means i will be creating a kind of 3D conversion program ).

Anyway , i have some questions :

1)in my code i'm using some Glut built-in methods and function to create object such as glutSolidTeapot() , glutSolidCube() etc .. I would like to know if i can "export" them to one of the formats named up above. If not , should i build my own functions to display them , so i can have the vertices position and save them in the files.

2)i'm already done with the obj parsing , but i have no clue on how the PLY and VRML files behave , i could use a little help here please , thanks !

##### Share on other sites

1)in my code i'm using some Glut built-in methods and function to create object such as glutSolidTeapot() , glutSolidCube() etc .. I would like to know if i can "export" them to one of the formats named up above. If not , should i build my own functions to display them , so i can have the vertices position and save them in the files.

I do not know a way to ask the models from OpenGL besides interception. You can download a GLUT source code from internet, e.g. here, and extract the mesh data (consiering any copyright, of course).

But I also do not see what this should be good for. Generating a cube is easy, and the teapot (like any hundreds of other meshes) can be loaded from the internet (e.g. here as OBJ).

2)i'm already done with the obj parsing , but i have no clue on how the PLY and VRML files behave , i could use a little help here please , thanks !

The specifications can be found on the internet, e.g. here for PLY. What exactly do you want to know?

However: I'm surprised of your intent.

a) Does PLY really play a role nowadays?

b) VRML is superseded by X3D. Besides that … VRML / X3D is a beast!

c) OBJ and PLY are both supported by AssImp for both import and export.

##### Share on other sites

Thanks again Haegarr ; i don't know if the PLY format still plays a role , but i was asked to implement it (see this more like an academic task to be done). I will take a look at assImp and the link you sent me for more details !

##### Share on other sites

So i have finally managed to import Ply and Obj files and implement them the right way in my code , but there's a visual detail that i would like to fix;

When an object is selected , i try to display its wire-frame on top of the model. The thing is , it works great with glut object(glutWiredTeapot for example) , but for the imported object as obj or ply , you can see and the triangular faces that do not look very good (especially from a certain distance , the density of the wireframe makes the object look white)

i would like to know if there's anyway i could delete those diagonal lines in the faces , just to display the wire-frame as Quads instead of triangles ;

here's the code i've used :

void MeshObj::WireFrameMode()
{

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);

glVertexPointer(0,GL_FLOAT,0,vertice);

glNormalPointer(GL_FLOAT,0,normals);

glDrawArrays(GL_LINES,0,n_data);

glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);

}

Edited by Hdjo

##### Share on other sites

The simplest solution would be to build a vertex element (i.e. vertex index) array on the CPU side and put only indices for interesting lines into it. You need to identify whether an edge is wanted or not. Is the mesh at the outset already build of triangles so that you need an algorithm to detect the kind of edge? May it happen that diagonal edges belong to the contour?

BTW: Your recent post has nothing to do with 3D file import, so you should have started a new topic for it. So, with a new title better matching the problem, you may have attracted more people who could help with this new problem.