• 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.

Michael Wojcik

Members
  • Content count

    32
  • Joined

  • Last visited

Community Reputation

163 Neutral

About Michael Wojcik

  • Rank
    Member

Personal Information

  1. At work on making the engine run nativly via C++. Target platforms: linux and android.
  2. Hello fellow developers, Some of you might remember me posting on game dev to get some help and in some cases helping others. I am happy to announce that I have finished my first game for Android. It is my game engine's first release. If you have an Android device, [url="https://play.google.com/store/apps/details?id=com.voidseer.voidengine&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS52b2lkc2Vlci52b2lkZW5naW5lIl0."]here it is![/url] [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]. Thank you all from this great community for your help. This is the first game of many games to come from me and my future company. If you buy it, thank you for your support! I hope you enjoy Escape Cyrocon!
  3. Perfect explanation! Fast reply! Thanks!! [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]
  4. I recently obtained a lua file like this, [CODE] return { file="Optimus.png", height=62, description={ family="Optimus", style="Regular", size=32 }, metrics={ ascender=46, descender=-16, height=62 }, texture={ file="IM:Textures:1:Textures/Optimus.png", width=512, height=256 }, chars={ {char=" ",width=13,x=1,y=39,w=0,h=0,ox=0,oy=0}, {char="!",width=10,x=2,y=9,w=8,h=30,ox=0,oy=30}, {char='"',width=20,x=11,y=9,w=17,h=11,ox=0,oy=30}, -- so on... }, } [/CODE] I don't see where the return keyword followed by the table would put the table in the global enviroment and can't seem to shed light on it from my lua book and googling. I am trying to parse it in luaj api and am in need of knowing where are the table is stored in the global enviroment after running the script. I do know that technically, a function in lua is a closure assigned to a variable. I would peronally just use the three tables as global variables here, but now I am quite curious what the original author did here. Thanks,
  5. True! Lol, Thanks for pointing that out, I should have noticed that normalization was not critical to the rotation calculation. Thanks for all your help!
  6. To the method to rotate the vector by a quaternion. [CODE] /** * Multiplys a quaternion q with a vector v to apply the q-rotation to v */ public Vector3 Rotate (Vector3 vec) { vecnormal.Set(vec); vecnormal.Normalize(); qVec.x = vecnormal.X; qVec.y = vecnormal.Y; qVec.z = vecnormal.Z; qVec.w = 0.0f; qConjugate.Set(this).Conjugate(); Quaternion qRes = qVec.Multiply(qConjugate); qTmpThis.Set(this); qRes = qTmpThis.Multiply(qRes); vec.X = qRes.x; vec.Y = qRes.y; vec.Z = qRes.z; return vec; }[/CODE] The result is always normal, no matter the magnitude of the input vector. Is this correct in the context of vector rotation via a quaternion? I was expecting the vector to be returned as a coordinate. I could ofcourse, could mutiply the result normal by the magnitude of the input vector. But I want to be sure if by definition, q * p * q-1 returns a rotated normal, or coordinate.
  7. Cool! Thats was indeed the issue! You saved me alot of time, thanks! I have another question regarding the result of quaternion - vector rotation. I noticed that If I were to pass <5.0, 0.0,0.0> I get a normal (0.707107,0.707107,0) as If I passed in <1.0, 0.0,0.0>. Does quaternion rotation with vector only work with vector normals? Or might I have messed something else up in my class?
  8. [CODE]Quaternion q = new Quaternion(0.0f, 0.0f, 45f);[/CODE] Initializes the quaternion in euler angles which calls this method [CODE] public void FromEulerAngles(float x, float y, float z) { float roll = MathHelper.DegreesToRadians(z); float pitch = MathHelper.DegreesToRadians(x); float yaw = MathHelper.DegreesToRadians(y); float cyaw, cpitch, croll, syaw, spitch, sroll; float cyawcpitch, syawspitch, cyawspitch, syawcpitch; cyaw = MathHelper.Cos(0.5f * yaw); cpitch = MathHelper.Cos(0.5f * pitch); croll = MathHelper.Cos(0.5f * roll); syaw = MathHelper.Sin(0.5f * yaw); spitch = MathHelper.Sin(0.5f * pitch); sroll = MathHelper.Sin(0.5f * roll); cyawcpitch = cyaw*cpitch; syawspitch = syaw*spitch; cyawspitch = cyaw*spitch; syawcpitch = syaw*cpitch; this.w = cyawcpitch * croll + syawspitch * sroll; this.x = cyawspitch * croll + syawcpitch * sroll; this.y = syawcpitch * croll - cyawspitch * sroll; this.z = cyawcpitch * sroll - syawspitch * croll; }[/CODE] The Quaternion.Set sets to the calling quaternion's members, the x,y,z,w from that of the quaternion passed into set. Here's Quaternion.Set [CODE] public Quaternion Set(Quaternion rhs) { this.x = rhs.x; this.y = rhs.y; this.z = rhs.z; this.w = rhs.w; return this; }[/CODE] Heres my Quaternion.Multiply, just in case [CODE] public Quaternion Multiply(Quaternion qLocal) { w = ((w * qLocal.w) - (x * qLocal.x) - (y * qLocal.y) - (z * qLocal.z)); x = ((w * qLocal.x) + (x * qLocal.w) + (y * qLocal.z) - (z * qLocal.y)); y = ((w * qLocal.y) + (y * qLocal.w) + (z * qLocal.x) - (x * qLocal.z)); z = ((w * qLocal.z) + (z * qLocal.w) + (x * qLocal.y) - (y * qLocal.x)); normalRegenerationCount++; return this; }[/CODE]
  9. Hello, I am using [url="http://content.gpwiki.org/index.php/OpenGL:Tutorials:Using_Quaternions_to_represent_rotation"]this[/url] webpage to build some of my methods for my game engine's quaternion class. I am having trouble with the vector rotation via quaternion code. In the webpage cited above, this is what it looks like. [CODE] // Multiplying a quaternion q with a vector v applies the q-rotation to v Vector3 Quaternion::operator* (const Vector3 &vec) const { Vector3 vn(vec); vn.normalise(); Quaternion vecQuat, resQuat; vecQuat.x = vn.x; vecQuat.y = vn.y; vecQuat.z = vn.z; vecQuat.w = 0.0f; resQuat = vecQuat * getConjugate(); resQuat = *this * resQuat; return (Vector3(resQuat.x, resQuat.y, resQuat.z)); } [/CODE] So I use it in my quaternion class but I get incorrect results. This is what I do to test the method... [CODE] Vector3 pos = new Vector3(1.0f, 0.0f ,0.0f); Quaternion q = new Quaternion(0.0f, 0.0f, 45f); pos = q.Rotate(pos);[/CODE] To my current perspective, this will give me [b]<~-0.707, ~0.707, 0.0f>[/b]. But it doesn't, I get [b]<-0.13529904, 0.3535534, -0.3744762>[/b], which seems to me to be way off. Here is my code for the quaternion-vector rotation method... [CODE] /** * Multiplys a quaternion q with a vector v to apply the q-rotation to v */ public Vector3 Rotate (Vector3 vec) { vecnormal.Set(vec); vecnormal.Normalize(); qVec.x = vecnormal.X; qVec.y = vecnormal.Y; qVec.z = vecnormal.Z; qVec.w = 0.0f; qConjugate.Set(this).Conjugate(); Quaternion qRes = qVec.Multiply(qConjugate); qTmpThis.Set(this); qRes = qTmpThis.Multiply(qRes); vec.X = qRes.x; vec.Y = qRes.y; vec.Z = qRes.z; return vec; } [/CODE] My code is in Java, so that is why it looks different. I apprecaite any help or ideas!! Thanks!
  10. I suppose the paper's frustum extraction routine only works for perspective matrices. I just double checked my implementation of the paper's routine and the normal I am getting for top plane for example is [0.0, 0.3737926, 0.9275124] not [0.0, 1.0, 0.0] as I would suspect.
  11. Indeed, I appreciate your confirmation, that what I had in mind as how to calculate the frustums for an orthogonal projection matrix is correct. In terms of the routine as explained in the paper, does that only work for perspective matrices though?
  12. Hello, I have read through most of this [url="http://www.cs.otago.ac.nz/postgrads/alexis/planeExtraction.pdf"]paper [/url]here that explains how to extract your camera's frustum planes. For my game I am using a orthogonal projection matrix which might explain why I am getting seemingly off plane normals. My question is, does the equation on that paper for the opengl version of frustum plane extraction work also for orthogonal projection matrices? If not, then I suppose I could create a routine myself since orthogonal projection is a box anyways. I don't want to do that though unless I know that this routine will not work for orthogonal matrices. I appreciate any help, Thanks!
  13. Thanks for the information. I'll post my fragment shader code since this is where I use the variable. [code] precision mediump float; uniform vec3 u_colorMod; uniform float u_opacity; uniform sampler2D u_tex[2]; uniform int u_texCount; uniform int u_blend[2]; varying vec2 v_texCoord0; varying vec2 v_texCoord1; ////////////////////////////////////////////////// // Functions // ////////////////////////////////////////////////// vec4 performFragmentBlends(int blendIndex, vec4 srcFragment, vec4 destFragment) { vec4 blendedColor = vec4(1.0,1.0,1.0,1.0); // The are blend constants that the void engine uses from a material script. if(blendIndex == 0) { // BLEND_REPLACE blendedColor = srcFragment; } else if(blendIndex == 1) { // BLEND_SOURCEALPHA blendedColor = (srcFragment.a * srcFragment) + ((1.0 - srcFragment.a) * destFragment); } else if(blendIndex == 2) { // BLEND_MODULATE blendedColor = vec4(srcFragment.rgb * destFragment.rgb, 1.0); } else { // BLEND_ADD blendedColor = vec4(srcFragment.rgb + destFragment.rgb, 1.0); } return blendedColor; } ////////////////////////////////////////////////// // Fragment Shader // ////////////////////////////////////////////////// void main() { vec4 finalColor = vec4(1.0, 1.0, 1.0, 1.0); vec4 texcolor[2]; texcolor[0] = texture2D(u_tex[0], v_texCoord0); texcolor[1] = texture2D(u_tex[1], v_texCoord1); // Blend textures together based on blend index for(int i = 0; i < u_texCount; i++) { finalColor = performFragmentBlends(u_blend[i], texcolor[i], finalColor); } // Modulate the color finalColor.rgb *= u_colorMod.rgb; // Set the opacity alpha value finalColor.a *= u_opacity; gl_FragColor = finalColor; } [/code] As a reminder, on the for loop, if I replace u_texCount with 2, the shader draws correctly. When u_texCount is used and set to 2 in my engine code, the shader draws incorrectly (it looks like a lot of multicolor stars). I appreciate the help.
  14. Okay, thanks for the clarification. Well, in my engine code side, I simply set the uniform to 1, for testing purposes. Still renders erroneously though. I suppose that might mean my hardware might not support it. I too saw that the specification made no specific rules about the concept.
  15. Thanks for the replies. What I mean by 'freak out' is that it compiles and links fine, but when my code is running and rendering the shader program, it draws sort of a lightshow instead of my texture. When I replace the uniform variable with a constant, I get my normal textures being rendered. So some things in GLSL from what samoth mentioned can be thought of as, it will compile for now, but it might not work. Good to know. Yet it is interesting that gdmarkou code works. My video card is a NVIDIA GeForce GTX 260. I verified that the uniform is also being set. I would prefer to make the iteration based on a uniform variable but I'll use constants if I must.