Stupid Question
Started by Zuka, Apr 19 2008 07:34 PM
12 replies to this topic
#1
Posted 19 April 2008 - 07:34 PM
I know this is a stupid question, and its probably been asked and answered before, but I'm too lazy to hunt it down.
How do I use a mesh in pure C++?
I don't really want to use DirectX, maybe OpenGL?
How do I use a mesh in pure C++?
I don't really want to use DirectX, maybe OpenGL?
#2
Posted 19 April 2008 - 07:36 PM
I guess I shouldn't say 'use', but more like display. Also, how do I navigate the 'workspace' with my 'camera'?
#3
Posted 19 April 2008 - 08:24 PM
You make an array of all the vertices, use glVertexPointer, glNormalPointer, glTexCoordPointer etc. (or glInterleavedArrays) to tell OpenGL where the different components of the vertex are, and then you call a function like glDrawArrays to draw them.
reedbeta.com - developer blog, OpenGL demos, and other projects
#4
Posted 19 April 2008 - 09:08 PM
First step is to stop being lazy ;)
#5
Posted 19 April 2008 - 10:40 PM
Thank you SO much, Reedbeta. You're ALWAYS helpful.
#6
Posted 19 April 2008 - 10:41 PM
How do I access the vertices, though? And how do I position the mesh in my 'world'?
#7
Posted 20 April 2008 - 01:59 AM
What do you mean by "access the vertices"? If you're talking about loading a mesh from a file, it depends on the format, and there are free libraries out there for most popular mesh file formats.
To position the mesh you can apply a rotation and/or translation to it, which could mean rotating/translating each vertex individually or (more likely) using OpenGL's built in transformation matrix (the "modelview matrix") to do it.
To position the mesh you can apply a rotation and/or translation to it, which could mean rotating/translating each vertex individually or (more likely) using OpenGL's built in transformation matrix (the "modelview matrix") to do it.
reedbeta.com - developer blog, OpenGL demos, and other projects
#8
Posted 20 April 2008 - 03:09 AM
Could you show me to a good *.an8 library? I'm HORRIBLE at Google searches, for some reason.
#9
Posted 20 April 2008 - 01:23 PM
There is one on the front page ;)
"Stupid bug! You go squish now!!" - Homer Simpson
#10
Posted 20 April 2008 - 07:50 PM
Yeah, I spotted that after I made this thread.
#11
Posted 24 April 2008 - 09:23 PM
Loading a mesh into memory can be complicated depending on what format your 3D model is saved in. You can find source code on the internet that shows you how to load common formats like 3ds, obj, mdl etc.
I've created some video tutorials showing how to load cob/scn files and display them in OpenGL.
Another option is to use autodesk's fbx sdk. They provide to you the code to load fbx files but you still need to know how to use the sdk to be able to render the data on the screen.
http://usa.autodesk....112&id=10775847
I've created some video tutorials showing how to load cob/scn files and display them in OpenGL.
Another option is to use autodesk's fbx sdk. They provide to you the code to load fbx files but you still need to know how to use the sdk to be able to render the data on the screen.
http://usa.autodesk....112&id=10775847
3D OpenGL, C++ Game Development Video Tutorials @
www.marek-knows.com
www.marek-knows.com
#12
Posted 24 April 2008 - 11:06 PM
Quote
I've created some video tutorials showing how to load cob/scn files and display them in OpenGL.
I am curious... Why video tutorials ?
If Prolog is the answer, what is the question ?
#13
Posted 24 April 2008 - 11:50 PM
I create video tutorials rather than written tutorials because I have found I learn better by watching someone, rather than reading text.
3D OpenGL, C++ Game Development Video Tutorials @
www.marek-knows.com
www.marek-knows.com
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












