Advertisement Jump to content
  • Advertisement

ProjectinMatrix

Member
  • Content Count

    40
  • Joined

  • Last visited

Community Reputation

106 Neutral

About ProjectinMatrix

  • Rank
    Member
  1. ProjectinMatrix

    Scene management and render interface?

    Ingenu, Thanks for the links, they are indeed relevant to what i am researching, i find them to be more useful than some of the books i have on the topic. Hodgman, HOLLY CRAP! That answers verbatim what i wanted to know! I can't thank you enough, your response filled in the gaps i was missing. Pretty sure i'm going to go with Ingenu's third suggestion, it sounds like a really good general purpose rendering framework. Thanks so much guys, i'll post my progress when i've made some.
  2. ProjectinMatrix

    Scene management and render interface?

    Thanks for the reply CRYP7IK, I'm trying to stay away from objects having render functions. What i'd like to do is something like class StaticMesh : Component { // static mesh stuff Transform* object; // in a scene graph, pointer to owner object's transform, has bool for visible }; class GameObject { Transform* m_transform; vector<Component*> m_components; // ... void addComponent(StaticMesh* sm) { // Static mesh specific add function } } So when a static mesh is added to a game object it is added to the render systems render list (sorted by material properties). When the render list loops trough each renderable object it looks at the transform (in scene graph) to see if the object should be rendered or not. Now i think this is a good start, the issues i'm having: looping trough the set of visible meshes might be too expensive.Should i be constructing my render list each frame? Also, i'm trying to avoid having a scene graph as all i've heard about it is how modern engines don't need one. Should i just keep a big ass object graph? If my visibility determination is handled by the visibility check i don't see the need for a scene graph...
  3. I'm trying to make a toy game engine (just for fun), i'm running into two big problems. First i have no clue how to organize scene management. I've read a lot about scene graphs, and lately a lot about not using them... What's the "modern" way of scene management? Should whatever manages the game objects also be responsible for creating a list of drawable objects? The second issue i'm having is designing a good rendering interface. Ideally i'd like something that has a "mesh" and "animatedMesh" class which can then be added to a render function (rather than having all the vertex info every game object that is drawable). I've been struggling with this for a while and can't seem to get a good grasp on a good renderer design. I recently read "Ultimate 3D game engine design & architecture" by allen sherrod. While it briefly touched on the topics i'm interested in the book managed to skip all the information that would have been useful for me. Any advice, web links, book suggestions? All help is welcome!
  4. I recently took on the challenge of building a game editor. The end goal is something like Unity. To the best of my knowledge the best way to do this is C#, and thanks to mono the C# project can published on multiple platforms. So, my question: I was thinking of using gtk#for this project as it seems like a pretty solid library. Does any one have any experience with gtk#? is it possible to skin the application to look similar to Unity if i use gtk? Or should i just go with a different library / approach all together? If so, any suggestions? Thanks guys!
  5. ProjectinMatrix

    no window resize pls

    [font="Consolas, Menlo, Monaco,"][size="4"]dwStyle=(WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX);[/font] [font="Consolas, Menlo, Monaco,"][/font][font="Consolas, Menlo, Monaco,"]The WS_OVERLAPPEDWINDOW style contains WS_THICKFRAME which is what makes the window resizable.[/font] [font="Arial,"] [/font][font="Arial,"]Hope that helps[/font] [font="Arial,"] [/font] [font="Arial,"]EDIT: I just saw that you are using glut... No idea how to handle that one.[/font]
  6. ProjectinMatrix

    Problem with "Release" mode in Visual C++

    Can you run the release exe from within visual studio?
  7. ProjectinMatrix

    Problem with "Release" mode in Visual C++

    Copy the exe file in the same directory as your .vcproj file. Does it crash from here too? If not then it's dependant on something with a relative path (Perhaps a texture?) that you need to manually copy so it is relative to where the exe is.
  8. ProjectinMatrix

    Problem with "Release" mode in Visual C++

    Right Click The Solution select Properties then in the left hand tree expand Linker Select Inpt Add the required lib files in the Additional Dependencies field. In the upper right of the window is a configuration dropdown, this is active, debug or both. Alternativaley you could just pragma it in a file [color="#666666"][font="monospace"]#pragma comment(lib, "opengl32.lib")[/font] [color="#666666"] Here is a minimal Win32 OpenGL window skeleton, the code should compile and run if you uncomment the pragma line. http://pastebin.com/eKFWUhsP
  9. ProjectinMatrix

    Moving water?

    Thanks Krohm. The Valve approach looks promising. I'm going to try to implement it. Thanks again for the tip
  10. ProjectinMatrix

    Moving water?

    A while back i posted on the forum about rendering water.You guys where so much help i decided to ask for help again. At the moment i have some pretty nice looking "Water" rendering with some waves. This looks great! The problem is i want to make a river, which is more along the lines of flowing water. I have no idea how to implement that. Can anyone please nudge me in the right direction for this? If anyone is interested here is the code i have so far: WinMain.cpp GLWater.h GLWater.cpp
  11. Hi Guys, I know there are a TON of resources and posts on this topic but i've yet to find one that explains more than just a vague concept. I'm looking for a good book / tutorial on low level scene management as far as rendering is concerned. A good way to produce draw lists, ect... Something where it's not just a vague concept but an actual tutorial which explains how to create an implementation. Again, i know there are a lot of resources on this; after two days of sifting trough links i still can't find exactly what i'm looking for. Thanks for any help!
  12. ProjectinMatrix

    Quaternion to Matrix

    fuuuuu..... Yeah, i didn't normalize the rotate vector. Added this to the function Vector nr = rotate.Normalized(); #define x nr.x #define y nr.y #define z nr.z Now it works perfectly. Thanks for pointing it out, i feel beyond dumb.
  13. ProjectinMatrix

    Quaternion to Matrix

    Hello again everyone. I need help once again. This time i'm trying to convert a Quaternion to a Matrix that i can use in OpenGL ES functions. I have a quaternion and a matrix class, and use a static function to try and convert the quaternion to a matrix Matrix Quaternion::ToMatrix(Quaternion& q) { float sqw = q.w*q.w; float sqx = q.x*q.x; float sqy = q.y*q.y; float sqz = q.z*q.z; float invs = 1.0f / (sqx + sqy + sqz + sqw); Matrix matrix = Matrix::identity; matrix.mat[0] = ( sqx - sqy - sqz + sqw) * invs; matrix.mat[5] = (-sqx + sqy - sqz + sqw) * invs; matrix.mat[10] = (-sqx - sqy + sqz + sqw) * invs; float tmp1 = q.x*q.y; float tmp2 = q.z*q.w; matrix.mat[4] = 2.0 * (tmp1 + tmp2) * invs; matrix.mat[1] = 2.0 * (tmp1 - tmp2) * invs; tmp1 = q.x*q.z; tmp2 = q.y*q.w; matrix.mat[8] = 2.0 * (tmp1 - tmp2) * invs; matrix.mat[2] = 2.0 * (tmp1 + tmp2) * invs; tmp1 = q.y*q.z; tmp2 = q.x*q.w; matrix.mat[9] = 2.0 * (tmp1 + tmp2) * invs; matrix.mat[6] = 2.0 * (tmp1 - tmp2) * invs; return matrix; } To test if this works i first create a quaternion using an angle and an axis Quaternion q = Quaternion::AngleAxis(50.0f, Vector(10.0f, 60.0f, -80.0f)); Then i convert that to a matrix Matrix toMat = Quaternion::ToMatrix(q); Next i create a matrix using the same agle axis Matrix newMat = Matrix::AxisAngleRotation(Vector(10.0f, 60.0f, -80.0f), 50.0f); Then i loop trough both matrices to print them out, the output of the matrix created from the quaternion is: 0.64 | 0.63 | 0.42 | 0.00 -0.58 | 0.77 | -0.24 | 0.00 -0.48 | -0.09 | 0.86 | 0.00 0.00 | 0.00 | 0.00 | 1.00 Now the output from the matrix created with an angle axis rotation is 36.36 | 275.61 | -239.8 | 0.00 153.04 | 128.61 | -1722.2 | 0.00 -331.73 | -1706.9 | 2286.80 | 0.00 0.00 | 0.00| 0.00 | 1.00 So am i doing something wrong? Or is this just a scaling issue?
  14. ProjectinMatrix

    Quaternion LookRotation(lookAt, up)

    For anyone having this problem: Quaternion Quaternion::LookRotation(Vector& lookAt, Vector& upDirection) { Vector forward = lookAt; Vector up = upDirection; Vector::OrthoNormalize(&forward, &up); Vector right = Vector::Cross(up, forward); #define m00 right.x #define m01 up.x #define m02 forward.x #define m10 right.y #define m11 up.y #define m12 forward.y #define m20 right.z #define m21 up.z #define m22 forward.z Quaternion ret; ret.w = sqrtf(1.0f + m00 + m11 + m22) * 0.5f; float w4_recip = 1.0f / (4.0f * ret.w); ret.x = (m21 - m12) * w4_recip; ret.y = (m02 - m20) * w4_recip; ret.z = (m10 - m01) * w4_recip; #undef m00 #undef m01 #undef m02 #undef m10 #undef m11 #undef m12 #undef m20 #undef m21 #undef m22 return ret; }
  15. ProjectinMatrix

    Find angle between Quaternion A and B

    *facepalm*
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!