Page:28 - News Archived: 3437

Title Date
Fitting model in camera viewport - Link Fri, 18 Sep 2015 16:02:15

Im trying to setup a form of character select screen where the user can select from a drop down a list of characters and that character is loaded and displayed in a separate window. Thats all working I create the character model parent it to a separate camera render it to a texture and put it in on my GUI. What Im struggling with is getting the model to fit nicely in the viewport so it fills the whole texture. In theory this should be simple I get the bounds of the model and use the those along with a chosen distance from the camera and frustum height at that distance to apply a local scale to the model so it just fits at the given distance. What usually happens though is that I get very odd scale values bounds.extents has something like 0.0010.0030.001 and when I try and scale to my desired height based on this the model ends up far too big and I can just see the characters foot in the display window. The model has a SkinnedMeshRenderer and Ive tried renderer.bounds renderer.localBounds baking the model to a Mesh and using its bounds but not of these seems to give correct results. Im sure Im doing something incredibly dumb in terms of mis-matching local and world coordinates for this calculation but has anyone created anything similar and could offer some pointers Thanks

Does D3D11_BIND_UNORDERED_ACCESS and D3D11_BIND_SHADER_RESOURCE should - Link Fri, 18 Sep 2015 13:04:24

Hello. Im creating a simple program with one buffer and one only compute shader. Every examples Ive seen so far used csDataBufferDesc.BindFlagsD3D11_BIND_SHADER_RESOURCE D3D11_BIND_UNORDERED_ACCESS It makes sense - this buffer will be used in a shader so it have to be a shader resource right Also Im reading and writing to any place in it so it have to be unordered. But I tried and for me this also works csDataBufferDesc.BindFlags D3D11_BIND_UNORDERED_ACCESS How its possible Why do we need thisD3D11_BIND_SHADER_RESOURCE at all

How to format the text by adding word spacing and letter spacing - Link Fri, 18 Sep 2015 12:43:57

Hi I am very very new in Graphics programming and on this forum. I have one following query and I hope this is right place to ask. If not please suggest me. I am currenlty developing one Windows Player which render and animate the Text 2d . I am using Slimdx DirectWrite and C to develope that. I am reading all the format properties like fontsize and line height word spacing and letter spacing from xml file provided and trying to apply it on text by using TextFormat and Layout. But here these components not provide more properties like Line height and word spacing. I have also tried to use LineMetrics but it also not that much usefull. So this is now quite difficult for me to render the text here. How I can do this by using slimd dx and C Thanks Abhishek

Smoothing me some normals. - Link Fri, 18 Sep 2015 12:11:21

Best way to smooth normals. I know of one method not sure if its very memory efficient. I just want a general method to smooth the lighting normals of a mesh. Thanks for the answers if I get any...

SDL Image - Link Fri, 18 Sep 2015 11:57:03

Hey Guy help me install SDL Image on my DEV C I tried some ways but i failed D I saw in some tutorials but it did not work Thanks

Help to review my first harder game - Link Fri, 18 Sep 2015 11:02:34

Hello so today I just finished my first harder game and I want to experienced programmers try to review my code and say whats wrong and try to advice me what to do better. Heres the source and game. httpsgithub.comPovilas-JablonskisSideScroller Controls w for jump climb up. s for crouch climb down. a for walk left climb. d for walk right climb. mouse1 to jump mouse must be higher than players sprite ESACAPE to PAUSE Objective is to reach the end sign. Thanks for advance.

Computations with DirectCompute. How to get data back - Link Fri, 18 Sep 2015 08:31:21

Hello Im trying to use my gpu for computations only I dont even create a swap chain. But Im not sure how to retrieve a data after shader do its job. I want to modify the same data I passed. For this Im using single structured buffer binded as D3D11_BIND_UNORDERED_ACCESS. As far as I know I need to use D3D11_CPU_ACCESS_READ together with D3D11_USAGE_STAGING. But in this case I have an error A D3D11_USAGE_STAGING Resource cannot be bound to any parts of the graphics pipeline so therefore cannot have any BindFlags bits set. My next approach was to create a structured unordered buffer with D3D11_USAGE_DEFAULT usage. I applied calculations on it next I called ID3D11DeviceContextCopyResource to copy this buffer to the one with D3D11_CPU_ACCESS_READ and finally read the data. But Im not sure this is a correct way - I dont like this extra copying between resources.

moving sprite ghosting anything we can do - Link Fri, 18 Sep 2015 06:40:00

HI there I started trying to build a simple engine the main goal for now is to get a nice structure to the code and flow in the game loop the first milestone would be to get a character sprite jumping and moving in a fake 2D environment. Development was moving forward and fairly smoothly I got a sprite on screen I was flipping the different frame of the animation by offsetting uvs in a sprite sheet etc all good. As soon as I added the movement component I started noticing this weird behaviour the texture looks slightly blurred during movement or anyway not super sharp as when it s steady. I can see a small ghosting 2-3px behind. I recorded the screen using shadow play 60fps recording and playing the video I get the same effect but stepping frame by frame each frame is nice clean and sharp. That kinda made my heart a bit at ease thinking that it must be a refreshing issue of the monitor. But there is still something that bothers me and it is ... why so far on my monitor I did not notice any ghosting while playing I play mostly 3d games bf4 witcher etc but I play also some platform game like Ori etc ... and as far as a I can remember I dont remember those ghosting problem. Which make me think is it there anything that can be done software wise to ease this hardware problem Or maybe is just my case of a single sprite with uniform light grey background a particularly bad case

Adjusting the amount of spirals for output - Link Fri, 18 Sep 2015 04:08:49

Hello I have been experimenting with a galaxy type shape in JavaScript. I have got a pretty decent looking shape. But i do not know how to reduce the amount of arms in my maths for the output. For example say i wanted to have two spiral arms instead of the amount I currently have for more variability i cannot figure out how to do it. If i just simply change the values in my maths such as the number of arms i wish to draw then the shape is lost completely. I am wondering if there is a bettersimpler solution to create the kind of thing I am trying to do. Here is a working example of the codehttpjsfiddle.neterh5r4jm And the relevant codelogicmaths settings var a 3 var numArms 20 var num 100 var stars 5 the draw function code for var arm 0 arm lt numArms arm for var p 0 p lt num p var pX a p Math.cosp Math.PI arm Math.random pY a p Math.sinp Math.PI arm Math.random fors 0 s lt stars s pX randFloat-15152 get random float between range -15 15 to 2 decimal places pY randFloat-15152 ctx.beginPath ctx.arcpXelement.width2pYelement.height2 0.5 0 Math.PI2 false ctx.fillStyle white ctx.fill ctx.closePath

DirectXJim Adams - Link Fri, 18 Sep 2015 01:23:09

Skeletal animation is hella slow - Link Fri, 18 Sep 2015 01:02:50

For skeletal animation I wrote a system where each scene node may have a Bone object attached to it. My render function looks like this void render animationController-gtupdateAnimationanimData manager.sceneGraph-gtrootSceneNode renderer.renderFramecam renderer.shaderProgramCache-gtgetObjectskeletal animation program The updateAnimation function traverses the scene graph starting from the root node with a delta_time variable and a stdmap of node names and their transformation time keys. in code stdunordered_mapltstdstring NodeAnimationDatagt The update function retrieves some values and then calls then next function which does all the magic void AnimationController_updateSceneNodeSceneNode sceneNode double time stdunordered_mapltstdstring NodeAnimationDatagt nodeAnimations ifsceneNode-gtanimationRunning return ifnodeAnimations-gtempty return const NodeAnimationData nodeAnim try nodeAnim nodeAnimations-gtat sceneNode-gtname catchconst stdout_of_range nodeAnim nullptr Bone bone sceneNode-gtbone ifnodeAnim bone double factor rotation const QuatKey currQuatKey nullptr nextQuatKey nullptr _getAnimationKeysltQuatKeygtnodeAnim-gtquatKeys time currQuatKey nextQuatKey factor time - currQuatKey-gttime nextQuatKey-gttime - currQuatKey-gttime factor glmclampfactor 0.0 1.0 glmquat rotation_quat glmslerpcurrQuatKey-gtquat nextQuatKey-gtquat floatfactor glmmat4 rotation_mat glmmat4_castrotation_quat position const VectorKey currPosKey nullptr nextPosKey nullptr _getAnimationKeysltVectorKeygtnodeAnim-gtpositionKeys time currPosKey nextPosKey factor time - currPosKey-gttime nextPosKey-gttime - currPosKey-gttime factor glmclampfactor 0.0 1.0 glmvec3 position_vec currPosKey-gtvec1.0f - floatfactor nextPosKey-gtvec floatfactor glmmat4 position_mat glmtranslateposition_vec set matrices bone-gtsetNodeMatrix sceneNode-gtparent-gtbone sceneNode-gtparent-gtbone-gtnodeMatrix glmmat41 position_mat rotation_mat bone-gtsetFinalMatrix bone-gtnodeMatrix bone-gtoffsetMatrix upload finalMatrix to shader stdstring str Bones91 char buf914 0 _itoa_sbone-gtindex buf 10 str buf str _shaderProgram-gtsetUniformstr.c_str bone-gtfinalMatrix pull out that animation node for speed nodeAnimations-gterasesceneNode-gtname recursively call for children forunsigned int i 0 i lt sceneNode-gtgetNumChildren i _updateSceneNodesceneNode-gtgetChildNodei time nodeAnimations The function basically inspects every node in the scene and checks if theres a match in the NodeAnimationData map. IOW if theres an animation for that nodes bone. If there is it calculates all the needed values and uploads the final bone matrix to the Bones array in the glsl shader. Ive tried to add some optimizations but this still works slowly with more than two animations running. Can anyone point out anything I could do better

collision detection in maze issue - Link Fri, 18 Sep 2015 00:27:18


Efficient rendering of a dynamic grid - Link Thu, 17 Sep 2015 20:38:22

Im trying to render a grid similar to Starcraft 2s build grid. I want each tile to change its color as efficiently as possible using a single shader for the whole grid. On the CPU side I have a byte C which contain the state of each tile free occupied conflict etc.. These states change each time the player moves a building over the grid or builds it. My idea right now is to send this data to the GPU through a StructuredBuffer submit a procedural drawcall and somehow change the color of the tiles based on the data and the vertexID. I have two potential problems with this There is no 8 bit scalar type in HLSL like byte. Should I convert my byte to a uint and pass that to the buffer instead I dont like the idea of having a duplicate of my data array. Is there a way to fake an 8 bit scalar in HLSL Im using Unity and the only way to update a buffer on the CPU side is to set the entire array of data. This could be done frequently each time the player moves the building to another position. I wonder if there is a more GPU-centric approach to fetch the state of each tile in my grid. I know this all sounds like premature optimization but my main goal here is to learn new ways to think about these kinds of problems. Thanks for any ideas.

Only the last instance is rendered - Link Thu, 17 Sep 2015 19:14:16

Hello GameDev I am porting an OpenGL 4.4 application to OpenGL 3.1 to get it to run on my Intel HD Graphics 3000 card on my laptop. So far things have been going well but I ran into a problem when rendering more than one instance using the same vertex buffer just changing the uniform buffer between the draw calls. When I do this only the last instance is rendered. The non-ported code did not exhibit this problem and I just cannot see what I might have done to cause it to fail. I have managed to isolate the bug in a minimal samplehttppastebin.com87DQhdrS include ltSDL2SDL.hgt include ltGLgl3w.hgt include ltiostreamgt include ltstringgt const int OPENGL_MAJOR 3 const int OPENGL_MINOR 1 const int UNIFORM_BINDING 1 const char VERTEX_SOURCE version 140 n n in vec2 in_position n n layoutstd140 uniform UniformBuffer n n vec4 offset n n n void main n n gl_Position vec4in_position 0.0f 1.0fn gl_Position.x offset.x n n const char FRAGMENT_SOURCE version 140 n n out vec4 out_color n n void main n n out_color vec41.0f 1.0f 1.0f 1.0f n n struct UniformBuffer float offset914 SDL_Window window nullptr SDL_GLContext glcontext nullptr unsigned int viewport_width 800 unsigned int viewport_height 600 bool running true GLuint vertexShader 0 GLuint fragmentShader 0 GLuint program 0 GLuint position_vbo 0 GLuint vao 0 UniformBuffer uniform_buffer_data GLuint uniform_buffer 0 void initialize void loadResources GLuint compileShaderconst char source GLuint type void linkProgramGLuint program void run void handleEvents void render int mainint argc char argv91 initialize loadResources run return 0 void initialize if SDL_Init0 0 throw stdruntime_errorFailed to initialize SDL window SDL_CreateWindowgl3 SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED viewport_width viewport_height SDL_WINDOW_OPENGL SDL_WINDOW_RESIZABLE if window nullptr throw stdruntime_errorFailed to create SDL window SDL_GLcontextFlag flags SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG ifndef NDEBUG flags SDL_GLcontextFlagflags SDL_GL_CONTEXT_DEBUG_FLAG endif SDL_GL_SetAttributeSDL_GL_CONTEXT_MAJOR_VERSION OPENGL_MAJOR SDL_GL_SetAttributeSDL_GL_CONTEXT_MINOR_VERSION OPENGL_MINOR SDL_GL_SetAttributeSDL_GL_CONTEXT_PROFILE_MASK SDL_GL_CONTEXT_PROFILE_CORE SDL_GL_SetAttributeSDL_GL_CONTEXT_FLAGS flags SDL_GL_SetAttributeSDL_GL_DEPTH_SIZE 32 SDL_GL_SetAttributeSDL_GL_STENCIL_SIZE 0 glcontext SDL_GL_CreateContextwindow if glcontext nullptr throw stdruntime_errorFailed to create OpenGL context if gl3wInit 0 throw stdruntime_errorstdstringFailed to initialize gl3w if gl3wIsSupportedOPENGL_MAJOR OPENGL_MINOR 1 throw stdruntime_errorOpenGL version not supported glClearColor0.0f 0.0f 0.0f 1.0f glViewport0 0 viewport_width viewport_height SDL_GL_SetSwapInterval1 void loadResources VBOs. float positions91 -0.5f -0.5f -0.5f 0.5f 0.5f -0.5f 0.5f 0.5f glGenVertexArrays1 vao glBindVertexArrayvao glGenBuffers1 position_vbo glBindBufferGL_ARRAY_BUFFER position_vbo glBufferDataGL_ARRAY_BUFFER sizeoffloat 8 positions GL_STATIC_DRAW glVertexAttribPointer0 2 GL_FLOAT GL_FALSE 0 0 glEnableVertexAttribArray0 Shaders. vertexShader compileShaderVERTEX_SOURCE GL_VERTEX_SHADER fragmentShader compileShaderFRAGMENT_SOURCE GL_FRAGMENT_SHADER program glCreateProgram glAttachShaderprogram vertexShader glAttachShaderprogram fragmentShader linkProgramprogram glUniformBlockBindingprogram glGetUniformBlockIndexprogram UniformBuffer UNIFORM_BINDING UBOs. uniform_buffer_data.offset910 0.0f uniform_buffer_data.offset911 0.0f uniform_buffer_data.offset912 0.0f uniform_buffer_data.offset913 0.0f glGenBuffers1 uniform_buffer glBindBufferBaseGL_UNIFORM_BUFFER UNIFORM_BINDING uniform_buffer glBufferDataGL_UNIFORM_BUFFER sizeofUniformBuffer sizeoffloat uniform_buffer_data GL_DYNAMIC_DRAW GLuint compileShaderconst char source GLuint type GLuint shader glCreateShadertype glShaderSourceshader 1 source nullptr glCompileShadershader GLint status glGetShaderivshader GL_COMPILE_STATUS status if status GL_TRUE GLint logSize glGetShaderivshader GL_INFO_LOG_LENGTH logSize stdstring log if logSize gt 0 int written log.resizelogSize glGetShaderInfoLogshader logSize written log910 throw stdruntime_errorFailed to compile shader log return shader void linkProgramGLuint program glLinkProgramprogram GLint status glGetProgramivprogram GL_LINK_STATUS status if status GL_TRUE GLint logSize glGetProgramivprogram GL_INFO_LOG_LENGTH logSize stdstring log if logSize gt 0 int written log.resizelogSize glGetProgramInfoLogprogram logSize written log910 throw stdruntime_errorFailed to link program log void run while running handleEvents render void handleEvents SDL_Event event while SDL_PollEventevent switch event.type case SDL_QUIT running false break case SDL_WINDOWEVENT switch event.window.event case SDL_WINDOWEVENT_RESIZED viewport_width event.window.data1 viewport_height event.window.data2 glViewport0 0 viewport_width viewport_height break break void render glClearGL_COLOR_BUFFER_BIT glUseProgramprogram glBindVertexArrayvao uniform_buffer_data.offset910 1.3f glBindBufferBaseGL_UNIFORM_BUFFER UNIFORM_BINDING uniform_buffer glBufferSubDataGL_UNIFORM_BUFFER 0 sizeofUniformBuffer sizeoffloat uniform_buffer_data glDrawArraysGL_TRIANGLE_STRIP 0 4 uniform_buffer_data.offset910 -0.4f glBindBufferBaseGL_UNIFORM_BUFFER UNIFORM_BINDING uniform_buffer glBufferSubDataGL_UNIFORM_BUFFER 0 sizeofUniformBuffer sizeoffloat uniform_buffer_data glDrawArraysGL_TRIANGLE_STRIP 0 4 SDL_GL_SwapWindowwindow I am using SDL2 and GL3W and I am working in Visual Studio 2013 on Windows 10. The biggest change when I ported was that I no longer could specify the uniform binding point in the shader but had to useglUniformBlockBindinginstead. Anyone familiar with this version of OpenGL who could tell me if I am doing something stupid Cheers - Rarosu

GPU brush strokes and 34undo34 - Link Thu, 17 Sep 2015 18:15:29

Im attempting to write a simple painting application and Im looking for strategies for using the GPU to handle most of the blending and rendering. Rendering several brush stamps onto a render target and make it look like a brush stroke is simple. But in order to enable the user to undo the previous strokes each stroke needs to be stored in memory as a separate state of the canvas in the form of tiles for example. When the user finishes a brush stroke by releasing the mouse etc. I grab the part of the render target that was modified and store it into a buffer. With a high resolution canvas 8192 x 8192 ARGB pixels for example in order to have a lot of undo levels you need a lot of memory video memory wont be enough. Not only that reading data from the render target onto system memory is very very slow. One test I did with such a large canvas took 200ms to complete. I would like for the user to be able to undo several levels in sequence imagine pressing CrtlZ CtrlZ CtrlZ fast. Im using Direct3D 9 and the GetRenderTargetData function. I can also use OpenGL 2.1. Am I missing something Is there a clever solution to this

Starting Game-Dev - Link Thu, 17 Sep 2015 17:24:30

I am now starting game developing or trying. I wanted to try a 3D side-scroller platformer and have some little experience with Game Maker. My question is what engine not Unity do you recommend I know C and looked at Ruby and Java before.

Porting execting directx code for Windows store app - Link Thu, 17 Sep 2015 16:59:04

Hey guys I have an existing directx 11 code working fine on win32 application but when I have integrated the same code in an universal platform app or in windows 8 store app I had some issue with all post process effect in my game. I get nothing when I bind a render target texture as a shader resource. After that I activated debugging mode it shows me only the following info D3D11 INFO ID3D11DeviceContextOMSetRenderTargets Forcing OM Render Target slot 0 to NULL since calling Present for DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL SwapChains unbinds backbuffer 0 from all GPU writeable bind points except for DXGI_PRESENT_DO_NOT_SEQUENCE or DXGI_PRESENT_TEST usage. STATE_SETTING INFO 49 OMSETRENDERTARGETS_UNBINDDELETINGOBJECT. Even more when I try to get a screenshot at the runtime using directXTex all I got is a black empty image. Could anyone help me please Thank you guys

How to use small datatypes efficiently - Link Thu, 17 Sep 2015 14:27:18

I used to use small datatypesshort char to save memorybut these types will likely need two bus transaction for operationstake this union for example union UValue struct short m_nVal1 short m_nVal2 int m_nVal uValue Tow bus transaction are needed to read m_nVal2 into cpuwhile i am not sure if this is the case for m_nVal1 cuz its four bytes alignedwill this be extremely slowis it wise to operate on m_nVal2 with some special tacticssay set uValue.m_nVal2 to 77 do it like this uValue.m_nVal uValue.m_nVal 65535 77 ltlt 16 Will this way be much faster thanuValue.m_nVal2 77 I am sure we all like the feeling that we coding in the best way. It can be encapsulated in a member function void UValueSetVal2int val m_nVal m_nVal 65535 77 ltlt 16

Texture atlas and clipping rectangle - Link Thu, 17 Sep 2015 14:01:22

I was wondering how do you properly do a clipping rectangle for a texture atlas Recently I have had issues with my texture atlas and clipping rectangles. For some reason the sprites I render occasionally are distorted. They are stretched in some way either on the X and Y axis. For example I use a clipping rectangle for my animations. I have an animation for a waving flag. When I need to change the animations frame I just move the clipping rectangle. Unfortunately on some frames it looks like the flag is growingshrinking even though the animation does not have this. Its seems like it is due to the issue above What is going on I believe that its due to my UV coords. I am setting my texture coords like this all calculations are using floats my projection matrix is scaled at 1.5 and my frag shader uses mediump for its uv coords uv top left x clipRect.x texture.width uv top left y clipRect.y texture.height uv top right x clipRect.x clipRect.width texture.width uv top right y clipRect.y texture.height uv bot left x clipRect.x texture.width uv bot left y clipRect.y clipRect.height texture.height uv bot right x clipRect.x clipRect.width texture.width uv bot right y clipRect.y clipRect.height texture.height

Best way to make campaign-file c - Link Thu, 17 Sep 2015 13:58:17

Hi Game programming or general programming thread In general how would i go about making a campaign save- file I have campaigns with some campaign-data and missions each has a map units settings etc. Mission-files are not the same size as they may have different no of units etc. Idea start file save campaign-data save mission1 save mission2 etc to last mission end file Now if i want to load mission 4 Load from the beginning of the file until i hit mission 4 Or how to edit mission 3 and resave it Or add another mission to the campaign or remove one Or should i have a folder for the campaign with loose files for each mission seems ugly. What is the general way to do this It needs to be practical when i or the user creates and edits campaigns and preferably all data in a single file Thanks a lot Erik

ENET peer list - Link Thu, 17 Sep 2015 10:10:07

Can i store the peer in some kind of array when someone connects to the server when peer connects to server becasue when client connects i can only access the poitner of that peer per one frame while enet_host_service srv-gtserver event 0 gt 0 if event.type ENET_EVENT_TYPE_CONNECT now event.peer is a pointer to ENetPeer and i am not sure if that will get destoryed or i can store that pointer in the array for further things. i need to store the peer list so server can send data to all connected clients

A General copy constructor question - Link Thu, 17 Sep 2015 09:03:34

When creating a QuadNode by giving it an id and t time variable I want to use back the original TimeAStarNode and QuadNode properties. Do I have to call back TimeAStarNode constructor like this and all other QuadNode properties will retain Thanks Jack class QuadNode public TimeAStarNode public QuadNodeconst quadvec2 bb QuadTree tree QuadNode parent const Pointltintgt top_right const Pointltintgt bottom_left float fHeightThresHold bool bRegularGridMode false int currentDepth 0 int maxDepth 0 bool init false QuadNodeconst QuadNode node ancestor is used to build quadtree which is the parent of current node TimeAStarNodenode.ancestor node.m_quadNode node.path_cost node.estimated_cost node.t node.depth overwrites current id this-gtid used to build paths this-gtparent node.parent this-gtm_pivot.x node.m_pivot.x this-gtm_pivot.y node.m_pivot.y this-gtm_boundingBox910 node.m_boundingBox910 this-gtm_boundingBox911 node.m_boundingBox911 this-gtm_vSize node.m_vSize this-gtm_vPos node.m_vPos this-gtm_tree node.m_tree this-gtm_bitRegions node.m_bitRegions this-gtm_bRegularGridMode node.m_bRegularGridMode this-gtm_fCurrentSize node.m_fCurrentSize this-gtnortheast node.northeast this-gtnorthwest node.northwest this-gtsoutheast node.southeast this-gtsouthwest node.southwest this-gtstatus node.status this-gtm_OverHangTris node.m_OverHangTris this-gttransitions node.transitions public QuadNodeint id long t TimeAStarNodethis-gtancestor this-gtm_quadNode this-gtpath_cost this-gtestimated_cost this-gtt this-gtdepth overwrites current id this-gtid id this-gtparent NULL this-gttransition 0

VS 2015 debugger not able to show string content - Link Thu, 17 Sep 2015 08:56:22

Hello Not long ago I switched from Visual Studio 2013 to new Visual Studio 2015. Everything went good compiling and working on it is much faster then before. Few new diagnostic tools great But... I have ugly problem which destroys everything. When I run my problem with debuger breaks somwhere in the code and try to look on my string variable I cant see its content. Instead of it I see npos value4294967295 and two error 0. Other types of variables even from my class works fine. Does anyone have same problem or know how to fix it Thanks

Visual Studio and AgileScrum book or other resource recommendations - Link Thu, 17 Sep 2015 04:33:01

Im sure many of you have seen my other recent post but in case not... Ive been out of work for some time due to ill health but just recently got the urge to dabble in some 3D Graphics Programming again. Ive downloaded Visual Studio 2015 Community Edition have ordered Frank D. Lunas Introduction to 3D Game Programming with Directx 11 and have started re-familiarising myself with Visual Studio. Now the thing is Ive not touched VS for well over 5 years and boy have they added new stuff And Im looking to find a books or other resources that will help bring me up to speed with all the new features unit tests integration with Visual Studio Online etc etc and at least an overview of Agile andor Scrum. So what books and other resources would people recommend Obviously there is this website and the MSDN and will be spending some time on both of those but I have always found I learn much better from a book than a website even one as great as this one clearlyis. Thanks in advance. Scott Hill.

PID steering controller flips from 0 to 178 - Link Thu, 17 Sep 2015 02:18:21

Hey all. Im working on a virtual robot sim using a PID controller in software. The problem is the object when travelingat 189it flips back to 0 which makes it spin back around its self and then enter some flipping loop. Im not sure if I need to reset the SetPoint in this case the setpoint is the targets position every iteration. if I dont set the new setpoint the object can miss the target. what I have is 4 waypoints waypoint0 -4000400 waypoint0 4000400 waypoint0 4000-400 waypoint0 -4000-400 if the object is traveling from waypoint 1 to 2 when it gets to waypoint 2 it starts flipping and also from 2 to 3 sometime it spins. I thought I could fix it with a resetting of the target after 50 steps But that stops it some times but it still there. this is the code for the loop. I could have it all wrong. Im using PI to -PI for min and max output. Ill go and try using 0 - 360 and not use radians I doubt that will work. . ----------------------------------------------------------------------- testing out using the pid controller to controll the direction and the speed ---------------------------------------------------------------------------- void Controllerupdatedouble timedelta ifHasDest false return temp fix not working static int scanahead 0 const int updates 50 defines the pid tunning control consKp 1.4 consKi 0.007 consKd 0.0005 PIDSteerController-gtSetTuningsconsKp consKi consKd RTSComponentMotion.m_dMass 5.1controls how quick the objects turns RTSComponentMotion.m_dMaxForce 260.0 RTSComponentMotion.m_dMaxSpeed 260.0controls the speed RTSComponentMotion.m_dMaxTurnRate 1.0 RTSComponentMotion.m_dRadius 260.0 Update the control and adjust the steering ifPIDSteerController-gtCompute double newHeading double turnRate float maxTurnRate 21.9 float maxRudder 30.9 Calculate rudder position from controller output rudder -maxRudder Output Take account of rudder end stops ifrudder gt maxRudder rudder maxRudder else ifrudder lt -maxRudder rudder -maxRudder Calculate turn rate from amount of rudder aplied it is assumed that above a certain amount of rudder turn rate will be constant TODO Rate of change of rate of turn turnRate 0.2 rudder Take account of max turn rate ifturnRate gt maxTurnRate turnRate maxTurnRate else ifturnRate lt -maxTurnRate turnRate -maxTurnRate float dt timedelta Calculate new heading Input Input turnRate dt do motion double theta 0.0RebuildTheta ok we need to build a direction from the input angle RTSComponentMotion.m_vHeading SphericalCoordinatesToCartesianRadiustheta Input D3DXVec3NormalizeRTSComponentMotion.m_vHeading RTSComponentMotion.m_vHeading create the acceleration in the direction we are heading D3DXVECTOR3 acceleration RTSComponentMotion.m_vHeading 1000.0 update velocity RTSComponentMotion.m_vVelocity acceleration timedelta timedelta make sure vehicle does not exceed maximum velocity RTSComponentMotion.m_vVelocity TruncateRTSComponentMotion.m_vVelocity RTSComponentMotion.m_dMaxForce update the position D3DXVECTOR30.0 0.0 0.0 RTSComponentMotion.m_vPos RTSComponentMotion.m_vVelocity timedelta RTSComponentMotion.m_vPos.y 0.0 get the direction to travel to target and the distance D3DXVECTOR3 targetp WayPoints91CurrentWayPoint targetp.y 1.0f D3DXVECTOR3 p RTSComponentMotion.m_vPos p.y 1.0 D3DXVECTOR3 distance targetp - p float t D3DXVec3Lengthdistance D3DXVECTOR3 newtargetnormalized this alligns the objects facing to the heading RotateObjectFacingDirectionToHeading0 see if we need to change way points ift lt RTSComponentMotion.m_dRadius scanahead 0 PIDSteerController-gtReset rudder 0 CurrentWayPoint ifCurrentWayPoint gt WayPoints.size CurrentWayPoint 0 we need to calulate the new direction to target we need to reset the steering controller for this next destination targetp WayPoints91CurrentWayPoint targetp.y 1.0f p RTSComponentMotion.m_vPos p.y 1.0 distance targetp - p D3DXVec3Normalizenewtargetnormalized distance set the PIDcontrollers new SetPoint get the angle using spherical coordinates CaluclateSphericalCoordinatesRadius RebuildThetaSetpointdouble Theta Setpoint newtargetnormalized.x newtargetnormalized.y newtargetnormalized.z distance.x distance.y distance.z this is test code to fix feed back loop not working D3DXVECTOR3 Facing RTSComponentMotion.m_vHeadingm_UnitsFacingDirection D3DXVECTOR3 Facingnormalized D3DXVec3NormalizeFacingnormalized Facing CaluclateSphericalCoordinatesRadius RebuildThetadouble Theta Input Facingnormalized.x Facingnormalized.y Facingnormalized.z Facing.x Facing.y Facing.z else scanahead ifscanahead gt updates scanahead 0 RTSComponentMotion.m_vHeading SphericalCoordinatesToCartesianRadiustheta Input D3DXVec3NormalizeRTSComponentMotion.m_vHeading RTSComponentMotion.m_vHeading targetp WayPoints91CurrentWayPointDestPos targetp.y 1.0fso we can stop because the pos has no y value too may fix this later p RTSComponentMotion.m_vPos p.y 1.0 distance targetp - p Input Setpoint PIDSteerController-gtReset rudder 0 D3DXVec3Normalizenewtargetnormalized distance this is the current new heading get the angle using spherical coordinates CaluclateSphericalCoordinatesRadius RebuildThetadouble Theta Setpoint newtargetnormalized.x newtargetnormalized.y newtargetnormalized.z distance.x distance.y distance.z end scan new target position end Controllerupdate

Zooming inout for objects in xy positions - Link Thu, 17 Sep 2015 00:05:37

So i have been a bit confused on the logic of how i would approach this. I have a bunch of objects in a fixed xy position on my canvas. And i want to zoom in and out with my mouse wheel. Then i was wondering how do I move the objects from their position to make seem like I am zooming in and out. Obviously they change in size but they would also move position - its the position on the output that has me a bit confused in terms of the logic. I use JavaScript to program my application but im just looking the logical approach to how i would do this. Most of my objects are in an array which contain and xy pixel position not a grid position. Any advice would be welcome

Zombie AI - Link Wed, 16 Sep 2015 23:39:58

I need an AI script for my zombie survival game. I have absolutely no programming skills because I am an artist not a programmer. Here is what I need the zombies to do 1. Zombies scream and growl when chasing players and are nearly silent otherwise 2. Zombies need to be able to detect loud sounds such as gunshots and explosions. When they hear them they should run toward the source 3. Zombies should wander around the map when not chasing the player or running toward loud noises. 4. Zombies should have random amounts of health. 5. Zombies should spawn out of the players sight because that would just look bad. 6. There should be lots of zombies spawning. I am using Unity 5 and the scripting language is unityScript. If you could give me an exact step-by-step guide as to how to implement the script you have come up with I would really appreciate it.

Passing Computations from VS to PS - Link Wed, 16 Sep 2015 22:42:56

Dear All I have done some matrix calculations in the VS that I want to re utilize in the PS. The problem I am having is that the slots of my PS buffer are already taken. Any thoughts on how can I read those computations from the PS previous done in the VS Thanks

Car transmission model - Link Wed, 16 Sep 2015 22:22:37

Hi everyone Im reviewing a car transmission model for a basic racing game and Ive noticed a slight discrepancy between what I would expect of the macroscopic properties of the model when changing gear and the numerical results. Here is the basic model from math import pi import numpy as np class Car gearRatios 91 maxTorqueArray 91 rpmAtMaxTorque 91 wheelRadius 0.0 differentialRatio 0.0 Cd 0.0 Crr 0.0 transmissionEfficiency 0.0 mass 0 def __init__self self.speed 0.0 self.acceleration 0.0 self.currentGear 1 def updateself dt throttle 1.0 Gear ratios assert self.currentGear gt 0 currentGearRatio self.gearRatios91self.currentGear - 1 effectiveGearRatio self.differentialRatio currentGearRatio transmission effectiveGearRatio self.transmissionEfficiency wheelCircumference 2 pi self.wheelRadius Find RPM wheelRPM self.speed wheelCircumference 60 engineRPM wheelRPM transmission engineRPM minmaxengineRPM self.rpmAtMaxTorque910 self.rpmAtMaxTorque91-1 Find torque at RPM maxTorque np.interpengineRPM self.rpmAtMaxTorque self.maxTorqueArray engineTorque maxTorque throttle wheelTorque engineTorque transmission tractionForce wheelTorque self.wheelRadius Resolve forces dragForce -self.Cd self.speed absself.speed rollingResistanceForce -self.Cd 30 self.speed Resultant resultantForce tractionForce dragForce rollingResistanceForce self.acceleration resultantForce self.mass self.speed self.acceleration dt self.currentForce resultantForce self.currentRPM engineRPM self.currentSpeed self.speed self.currentTorque wheelTorque class BoxsterS2004Car gearRatios 913.82 2.20 1.52 1.22 1.02 0.84 maxTorqueArray 91220 220 310 220 rpmAtMaxTorque 910 1000 4500 6600 wheelRadius 0.345 differentialRatio 3.42 Cd 0.32 transmissionEfficiency 0.7 mass 1300 if __name__ __main__ car BoxsterS2004 dt 1 60 while True car.updatedt Now in its actual implementation Im running the update function in a fixed-step game loop which allows me to inspect the car state and shift gear at runtime. Now the behaviour It is to be expected that the force of the car drops according to the speed for the same power. It is also to be expected that the car cannot reach as high a speed in lower gears. Yet for these parameters the top speed can only be reached in 1st gear and decelerates according as the gears are shifted higher. Im not sure why this happens. It makes sense that the acceleration rate is lesser for higher speeds because the drag force is proportional to v2 and the force of the engine falls with higher gears but my resultant forces are negative for higher gears when theyre not for the lower gears. Shifting at any point reduces the max speed achievable. Evidently I dont quite understand the model well enough could anyone point me in the right direction To my mind given that the driving force of the car falls off at

Gaming News Headlines - Yahoo News - Link Sun, 20 Sep 2015 08:37:00

ltpgtlta 30 height86 altWhy Final Fantasy 14 Isnamp039t Available on Xbox One alignleft titleWhy Final Fantasy 14 Isnamp039t Available on Xbox One border0 gtltagtMicrosoftamp039s Phil Spencer says heamp039s not a huge fan of third-party exclusivity deals.ltpgtltbr clearallgt

Why Final Fantasy 14 Isnt Available on Xbox One - Link Sun, 20 Sep 2015 08:23:00

ltpgtlta 30 height86 altGet PlayStation 4 Destiny Bundle and MGS 5 for 400 alignleft titleGet PlayStation 4 Destiny Bundle and MGS 5 for 400 border0 gtltagtPick up the special-edition system and Konamiamp039s celebrated stealth-action game at a nice discount.ltpgtltbr clearallgt

Get PlayStation 4 Destiny Bundle and MGS 5 for 400 - Link Sun, 20 Sep 2015 07:52:00

ltpgtlta 30 height86 altHalo Reach Xbox One Backwards Compatibility Teased alignleft titleHalo Reach Xbox One Backwards Compatibility Teased border0 gtltagtXbox One executive Phil Spencer says he would ampquotlike to seeampquot the 2010 shooter come to Xbox One.ltpgtltbr clearallgt

Halo Reach Xbox One Backwards Compatibility Teased - Link Sat, 19 Sep 2015 13:43:00

ltpgtlta 30 height86 altGet a Sneak Peek at the Custom Crackdown 3 Xbox One Controller alignleft titleGet a Sneak Peek at the Custom Crackdown 3 Xbox One Controller border0 gtltagtHereamp039s how the design is shaping up right now.ltpgtltbr clearallgt

Get a Sneak Peek at the Custom Crackdown 3 Xbox One Controller - Link Sat, 19 Sep 2015 13:12:00

ltpgtlta 30 height86 altPS4 Price Cut Predicted By Xbox One Boss alignleft titlePS4 Price Cut Predicted By Xbox One Boss border0 gtltagtampquotItamp039s great for gamers when price competition happens.ampquotltpgtltbr clearallgt

PS4 Price Cut Predicted By Xbox One Boss - Link Sat, 19 Sep 2015 05:40:00

ltpgtlta 30 height86 altNintendo Characters Coming to Strategy RPG Project X Zone 2 alignleft titleNintendo Characters Coming to Strategy RPG Project X Zone 2 border0 gtltagtFire Emblem and Xenoblade Chronicles characters will make crossover appearances in the cameo-filled Namco Bandai game.ltpgtltbr clearallgt

Nintendo Characters Coming to Strategy RPG Project X Zone 2 - Link Sat, 19 Sep 2015 03:58:29

ltpgtlta srchttpl1.yimg.combtapires1.2ANDP6.W4rBhCCB7_IVufoQ--YXBwaWQ9eW5ld3NfbGVnbztmaT1maWxsO2g9ODY7cT03NTt3PTEzMA--httpmedia.zenfs.comen-UShomerunpolygon.vox.comeefcd5052f66ae6c2014cc7468b05c68 30 height86 altDead or Alive Xtreme 3 launches spring 2016 with PlayStation VR support alignleft titleDead or Alive Xtreme 3 launches spring 2016 with PlayStation VR support border0 gtltagtTeam Ninjaamp039s third entry in its vacation and volleyball-themed spin-off of the Dead or Alive fighting game franchise will be released in Japan next spring the developer announced at Tokyo Game Show today. The PlayStation 4 version of the game known as Dead or Alive Xtreme 3 Fortune will support Sonyamp039s virtual reality headset PlayStation VR. The developer also announced the cast of Dead or Alive Xtreme 3 which is also coming to PlayStation Vita under the name Dead or Alive Xtreme 3 Venus.ltpgtltbr clearallgt

Dead or Alive Xtreme 3 launches spring 2016 with PlayStation VR - Link Fri, 18 Sep 2015 16:36:44

Microsoft has been promoting the New Xbox One Experience for months now but this weekend preview program members are finally going to get a chance to take the updated software for a spin. READ MOREHilarious Cortana fail Microsoft CEO Nadella got burned while demoing Cortana on-stage In a post on the Xbox Wire Larry Major Nelson Hyrb announced that the NXOE I know doesnt exact roll off the tongue is being distributedto some preview members this weekend. After this initial rollout Microsoft is planning to continually update the preview in the coming weeks until the public release in November. The Xbox One has improved dramatically since launch but the team knew that the interface needed work. With the fall update

See all the colossal changes coming to the Xbox One dashboard this - Link Fri, 18 Sep 2015 16:32:51

ltpgtlta srchttpl3.yimg.combtapires1.2AVFRvR.URAAjMy4zgb2cPw--YXBwaWQ9eW5ld3NfbGVnbztmaT1maWxsO2g9ODY7cT03NTt3PTEzMA--httpmedia.zenfs.comen-UShomerunpolygon.vox.com869d6d221a03bedbc9b445182622c022 30 height86 altXbox One Elite controller gets a release date alignleft titleXbox One Elite controller gets a release date border0 gtltagtThe Xbox One Elite controller will launch Oct. 27 according to Microsoftamp039sonline store.ltpgtltbr clearallgt

Xbox One Elite controller gets a release date - Link Fri, 18 Sep 2015 15:38:01

ltpgtlta 30 height86 altXbox One Elite controller release date revealed by retailers alignleft titleXbox One Elite controller release date revealed by retailers border0 gtltagtHave an extra 150 kicking around Hereamp039s when you can buy the new transforming controller.ltpgtltbr clearallgt

Xbox One Elite controller release date revealed by retailers - Link Fri, 18 Sep 2015 14:30:02

ltpgtlta srchttpl.yimg.combtapires1.22Q.X1d9zoOYCRdEXxg_z4A--YXBwaWQ9eW5ld3NfbGVnbztmaT1maWxsO2g9ODY7cT03NTt3PTEzMA--httpmedia.zenfs.comen-UShomerunpolygon.vox.com06d58cc3567bb0caf36def7de4b633c3 30 height86 altPreview the new Xbox One dashboard starting this weekend alignleft titlePreview the new Xbox One dashboard starting this weekend border0 gtltagtThe New Xbox One Experience will be available to members of the preview program starting from today Xbox Liveamp039s director of programming Larry Hryb also known as Major Nelson announced in a post tohis site.ltpgtltbr clearallgt

Preview the new Xbox One dashboard starting this weekend - Link Fri, 18 Sep 2015 13:15:00

ltpgtlta 30 height86 altCheck Out Xbox Oneamp039s New Totally Revamped Interface in Action alignleft titleCheck Out Xbox Oneamp039s New Totally Revamped Interface in Action border0 gtltagtSee the new guide Home screen and more.ltpgtltbr clearallgt

Check Out Xbox Ones New Totally Revamped Interface in Action - Link Fri, 18 Sep 2015 12:00:00

ltpgtlta 30 height86 altGaming Deals Madden Xbox One Bundle 50 GC 10 Titanfall 10 StarCraft 2 alignleft titleGaming Deals Madden Xbox One Bundle 50 GC 10 Titanfall 10 StarCraft 2 border0 gtltagtFree Shovel Knight expansion 6 Banner Saga 22 Code Name Steam 20 Civilization Beyond Earth and more.ltpgtltbr clearallgt

Gaming Deals Madden Xbox One Bundle 50 GC 10 Titanfall 10 StarCraft 2 - Link Fri, 18 Sep 2015 11:25:45

ltpgtlta srchttpl.yimg.combtapires1.2gpWdz1KUpVzp7Ww82BgDRg--YXBwaWQ9eW5ld3NfbGVnbztmaT1maWxsO2g9ODY7cT03NTt3PTEzMA--httpmedia.zenfs.comen_USNewsUS-AFPRelax000_hkg10209947.d9b2e111559.original.jpg 30 height86 altSonyamp039s PlayStation VR at the Tokyo Game Show alignleft titleSonyamp039s PlayStation VR at the Tokyo Game Show border0 gtltagtPlayStationamp039s recently rebranded virtual reality headset will sell for around the same price as a new console says Sony Computer Entertainmentamp039s CEO Andrew House.ltpgtltbr clearallgt

PlayStation VR to attract console price - Link Fri, 18 Sep 2015 11:09:00

ltpgtlta 30 height86 altMicrosoft Patents Wearable Smart Bracelet Hints at Toys-To-Life Gaming on Xbox alignleft titleMicrosoft Patents Wearable Smart Bracelet Hints at Toys-To-Life Gaming on Xbox border0 gtltagtDevice enables Skylanders Disney Infinity and Amiibo-like experiencesltpgtltbr clearallgt

Microsoft Patents Wearable Smart Bracelet Hints at Toys-To-Life Gaming - Link Fri, 18 Sep 2015 08:14:00

ltpgtlta 30 height86 altNintendoamp039s Next Controller May Have Scrolling Wheels Instead of Shoulder Buttons alignleft titleNintendoamp039s Next Controller May Have Scrolling Wheels Instead of Shoulder Buttons border0 gtltagtNew patent also indicates it will have a touch screen only two face buttons.ltpgtltbr clearallgt

Nintendos Next Controller May Have Scrolling Wheels Instead of - Link Fri, 18 Sep 2015 05:34:00

ltpgtlta 30 height86 altFinal Fantasy Agito PlayStation Vita Port Cancelled alignleft titleFinal Fantasy Agito PlayStation Vita Port Cancelled border0 gtltagtSquare Enix issues an apology on Twitterltpgtltbr clearallgt

Final Fantasy Agito PlayStation Vita Port Cancelled - Link Fri, 18 Sep 2015 00:21:33

ltpgtlta srchttpl1.yimg.combtapires1.2I4iL5zaCKanoz4QtTllCFA--YXBwaWQ9eW5ld3NfbGVnbztmaT1maWxsO2g9ODY7cT03NTt3PTEzMA--httpmedia.zenfs.comen-UShomerunpolygon.vox.comef7ff65ebba8507e8359a8070cb0480a 30 height86 altNintendo delays Star Fox Zero to 2016 alignleft titleNintendo delays Star Fox Zero to 2016 border0 gtltagtNintendo and Platinum Gamesamp039 new Star Fox game for Wii U wonamp039t make itspreviously planned holiday 2015 release. In a post onFacebook Nintendo said itamp039s pushingStar Fox Zero to 2016 in an effort to further polish the game. A statement from game designer Shigeru Miyamoto broke the news that Star Fox Zero had been delayed into the first quarter of next year.ltpgtltbr clearallgt

Nintendo delays Star Fox Zero to 2016 - Link Thu, 17 Sep 2015 19:50:30

ltpgtlta 30 height86 altTry and fail to land the Space X Falcon 9 with this video game alignleft titleTry and fail to land the Space X Falcon 9 with this video game border0 gtltagtIt really is crazy-hard to land the Falcon 9 rocket on a floating platform without completely screwing it up.ltpgtltbr clearallgt

Try and fail to land the Space X Falcon 9 with this video game - Link Thu, 17 Sep 2015 13:50:00

ltpgtlta 30 height86 altWindows 10amp039s Xbox App Adds New Features Today Preview Beta Version Coming Soon alignleft titleWindows 10amp039s Xbox App Adds New Features Today Preview Beta Version Coming Soon border0 gtltagtReal-time friends list and activity feed updates Xbox One text entry and more.ltpgtltbr clearallgt

Windows 10s Xbox App Adds New Features Today Preview Beta Version - Link Thu, 17 Sep 2015 13:00:55

ltpgtlta 30 height86 altDestiny The Taken King breaks PlayStation download records alignleft titleDestiny The Taken King breaks PlayStation download records border0 gtltagtBungieamp039s latest expansion is now the most-downloaded title on launch day in PlayStation history.ltpgtltbr clearallgt

Destiny The Taken King breaks PlayStation download records - Link Thu, 17 Sep 2015 11:42:00

ltpgtlta 30 height86 altNew Xbox One Experience Tester Version Issues Outlined alignleft titleNew Xbox One Experience Tester Version Issues Outlined border0 gtltagtDestiny and Borderlands may fail to load while Forza 6 could experience graphical issues during the initial wave of testing.ltpgtltbr clearallgt

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68

Welcome to

Floating Point Softwares is an Indie company started in 2015
focusing mainly on Android, iOS, HTML5 and PC game development.
Currently we also offer non-game related solutions, 
such as mobile apps depending on the demand, as well as pixel & vector graphics.

Read more

What's Going On?

Featured Shop Items