• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Dbof

Members
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

105 Neutral

About Dbof

  • Rank
    Newbie
  1. OMG...figured out by myself. The formula I was using for the lookAt was wrong. void dbCamera::lookAt(dbVector3 target) { camUp = dbVector3(0.f, 1.f, 0.f); // this is what was missing... // from: http://msdn.microsoft.com/en-us/library/windows/desktop/bb281710%28v=vs.85%29.aspx camDirection = dbVector3Norm(target - camPos); camRight = dbVector3Norm(dbVector3Cross(camUp, camDirection)); camUp = dbVector3Norm( dbVector3Cross(camDirection, camRight) ); } I confused the camera up-vector with the world up-vector...
  2. I'm trying to implement rotation functions for a camera. Here is some code: void dbCamera::rotateAroundXYZ(dbVector3 position, float angle){ // from: http://www.gamedev.net/topic/183293-camera-rotating-a-vector-around-an-arbitrary-axis/ dbVector3 vNewView; dbVector3 vView = camPos - camDirection; float cosTheta = cos(angle); float sinTheta = sin(angle); // x position of the new rotated point vNewView.x = (cosTheta + (1 - cosTheta) * position.x * position.x) * vView.x; vNewView.x += ((1 - cosTheta) * position.x * position.y - position.z * sinTheta) * position.y; vNewView.x += ((1 - cosTheta) * position.x * position.z + position.y * sinTheta) * vView.z; // y position of the new rotated point vNewView.y = ((1 - cosTheta) * position.x * position.y + position.z * sinTheta) * vView.x; vNewView.y += (cosTheta + (1 - cosTheta) * position.y * position.y) * vView.y; vNewView.y += ((1 - cosTheta) * position.y * position.z - position.x * sinTheta) * vView.z; // z position of the new rotated point vNewView.z = ((1 - cosTheta) * position.x * position.z - position.y * sinTheta) * vView.x; vNewView.z += ((1 - cosTheta) * position.y * position.z + position.x * sinTheta) * vView.y; vNewView.z += (cosTheta + (1 - cosTheta) * position.z * position.z) * vView.z; camPos = camDirection + vNewView;} This seems to work for now. My problem now is the looAt function: void dbCamera::lookAt(dbVector3 target){ // from: http://msdn.microsoft.com/en-us/library/windows/desktop/bb281710%28v=vs.85%29.aspx camDirection = dbVector3Norm(target - camPos); camRight = dbVector3Norm(dbVector3Cross(camUp, camDirection)); camUp = dbVector3Norm( dbVector3Cross(camDirection, camRight) );} The function names should be self-explanatory. The bug acts when I try to rotate around an axis while looking at a point on the axis. What I want to achieve is a camera which can rotate around an object and always looks at it (like a 3rd person camera). What the camera does is...well, rotate around itself during the rotation. http://youtu.be/CKud5uKotxE Uploaded a short video of the rotation. The first rotation is on the same Y-position of the car. The second one the camera goes up and it all fucks up. Any idea what may cause this problem? Thanks in advance!
  3. [quote name='undead' timestamp='1314780637' post='4855798'] [quote name='Dbof' timestamp='1314778699' post='4855792'] And this is my problem. I do not want the light to affect the cube if it is outside of it. As you can see, it is very unrealistic that the side walls are visible when the light rays are not supposed to light them. [/quote] If the normals are flipped (they point on the inside) then from what I see the results are ok. Kidsnapper4 clearly shows the top isn't affected because the normals are flipped but the lit face normals are actually pointing at the light. You need a shadowing system or if you need a quick trick just check if the light is outside the cube. When it's outside just set one parameter of your light equation to zero. [/quote] Oh, this means when the normals are at an angle of less than 90 degrees from the light, they are automaticly lit? Probably did not consider it, thank you. I am going to check what I can do against.
  4. Thanks god someone answered. Ok, I really thought it was clear. Once again. I want to create a scene with a cube. This cube should not be visible/lit. Imagine a military bunker which is only lit from the inside and has thick walls, so the light can't be perceived from the outside. The range is not important for now, everything should be affected by light for now. I thought by inverting the normals of my cube, so their direction go into the cube, It would be possible to light the cube from the inside only. This is the cube (which has a little window): [url="http://dbof.redio.de/screen/kidsnapper2.jpg"]http://dbof.redio.de...kidsnapper2.jpg[/url] The sphere above the cube is the (only) light source (point light) [url="http://dbof.redio.de/screen/kidsnapper3.jpg"]http://dbof.redio.de...kidsnapper3.jpg[/url] When the light is near the top, but outside of the cube, the top is dark, while the rest is lit, which is very unrealistic, because there should not be any light shining on the sides: [url="http://dbof.redio.de/screen/kidsnapper4.jpg"]http://dbof.redio.de...kidsnapper4.jpg[/url] When the light is moved near another wall, which was theoretically not hit by the light, it becomes dark: [url="http://dbof.redio.de/screen/kidsnapper6.jpg"]http://dbof.redio.de...kidsnapper6.jpg[/url] And this is my problem. I do not want the light to affect the cube if it is outside of it. As you can see, it is very unrealistic that the side walls are visible when the light rays are not supposed to light them. Now any ideas? I hope I get a faster answer this time
  5. Hello! I'm pretty new to this forum and I already have a few questions to ask. I'm trying to light a scene correctly. My attempt is to have a closed room (cube) and light it from the inside, so you have to put the camera inside the room to see something. Before I realized I had to flip the normals, I could only light the room from the outside. The problem I'm encountering now can be seen in this picture: [url="http://i.min.us/ib0xXBIBEvY3LV.jpg"]http://i.min.us/ib0xXBIBEvY3LV.jpg[/url] The light in the middle of the screenshot (which is a sphere) contains a point light: [code]light.Type = D3DLIGHT_POINT; light.Position = pos; light.Range = 1000.f; light.Diffuse = Diffuse; [i]//White[/i] light.Specular = Specular; [i]//White[/i] light.Ambient = Ambient; [i]//Really dark (0.05, 0.05, 0.05)[/i] light.Attenuation0 = 0.f; light.Attenuation1 = 0.01f; light.Attenuation2 = 0.f;[/code] I created the cube with Blender and flipped the normals, so that the walls are lit from the inside of the cube. As you can see, when the light is outside of the cube, the cube's walls, which are not in the light's shining range, are lit. Any idea how to fix this issue? Hope I was clear enough.. Thank you in advance!