Jump to content

  • Log In with Google      Sign In   
  • Create Account

Madhed

Member Since 13 Jun 2001
Offline Last Active Today, 04:01 PM

#5163721 sse-alignment troubles

Posted by Madhed on 29 June 2014 - 05:09 PM

http://www.codersnotes.com/sleepy

 

ph34r.png




#5162321 -march=pentium3 -mtune=generic -mfpmath=both ?

Posted by Madhed on 23 June 2014 - 07:51 AM

inline void TransformPointByModelMatrix(float* px, float* py, float* pz)

 

Um... you supply the vector as three separate pointers?

Something is telling me that this has to be extremely slow.

 

try changing the signature to

void TransformPointByModelMatrix(float* p)

and use the array element operator [] to access the separate elements and see if it makes any difference.




#5161675 threading the scanline rasterizer

Posted by Madhed on 20 June 2014 - 04:55 AM

You could use a tiled renderer. Like the PowerVR series of GPUs.

 

http://en.wikipedia.org/wiki/Tiled_rendering




#5161360 Explosive tangent impulses causes extreme rotation

Posted by Madhed on 18 June 2014 - 01:23 PM

The circle-circle friction seems to be inverted. In the first video you can see, when the circle that gets pushed up falls onto the fast spinning circle, it starts to turn in the wrong direction,




#5160909 float or double depth buffer?

Posted by Madhed on 16 June 2014 - 01:33 PM

try both, then make an informed decision




#5159603 Refactoring if-conditions for player turn code

Posted by Madhed on 10 June 2014 - 03:10 PM

I want to add something to my last post.

 

If you have a function that returns 4 distinct values but there are some code paths that return the same value this is a very good indicator that the function can be refactored into a simpler solution.

 

When doing calculations in vector space I'd always recommended to scribble up a diagram except for the simplest of cases.




#5159598 theoretical of practical safety of binary (www) plugins ?

Posted by Madhed on 10 June 2014 - 02:55 PM

Microsoft did it with ActiveX, which was... bad, very bad.

Not only is it a huge security risk but on top of that you'd have to provide different executables, at least for x86 and ARM




#5159591 Refactoring if-conditions for player turn code

Posted by Madhed on 10 June 2014 - 02:13 PM


Yep, this does indeed work, thanks a lot, thats a whole lot easier. Except that I somehow got up and down mixed up, at least its easier to fix in your version So the general advice for such monstrous if-statements would be "look for an easier algorithmn", or is there some recommandation in case there is no easier algorithmn scheme?

 

I started by drawing a crude diagram and looking for a mathematical solution. Sometimes it's easier to visualize that way.




#5159573 Refactoring if-conditions for player turn code

Posted by Madhed on 10 June 2014 - 01:31 PM

unsigned int DirectionFromMove(const math::Vector2& vMove)
{
    if(vDir.x < vDir.y) {
        // left or up
        if (vDir.x > -vDir.y){
            return 3;
        }
        else {
            return 1;
        }
    }
    else {
        // right or down
        if (vDir.x > -vDir.y){
            return 2;
        }
        else {
            return 0;
        }
    }
}

I hope this works... gone testing...

EDIT: Seems to work. What this does is separating the space by the function f(x) = x and after that by the function f(x) = -x testing which side of the half-plane the point lies in.




#5159239 whats this? javscript/ga

Posted by Madhed on 09 June 2014 - 06:28 AM

Fir, if you only want to talk you should post to the lounge.

 

I don't know if it is the language barrier playng into this, but your attitude just comes over as rude and condescending. You can't expect other users of this forum spoon feeding you the solutions to problems you encounter while you are programming, when you could have found the answers yourself with half an hour of research.

 

Instead you are expecting dozens of people to invest their own free time to do the work for you while you sit around and wait for the responses to fly in.

 

Take your original post for example: If I hadn't known what this code does I would have immediately seen the string "GoogleAnalyticsObject". Put the exact string into google search and the second result is a detailed explanation of what this code does.




#5159146 whats this? javscript/ga

Posted by Madhed on 08 June 2014 - 03:04 PM

fir, you should probably first learn the basics of javascript before diving into canvas stuff etc. As a seasoned js coder I can assure you that you will have many more WTF moments in the future.

 

Most of the stuff you have asked here will be covered in any javascript tutorial online.

 

* Quirks of the *this* pointer

* event handlers

* regular expressions

 

etc etc.




#5159116 whats this? javscript/ga

Posted by Madhed on 08 June 2014 - 12:46 PM

/Android|webOS|iPhone|iPad|iPod|BlackBerry/i

Is a regular expression. Javascript has a special syntax to create them on the fly.




#5158540 Screenspace Shadow Mapping Help!?

Posted by Madhed on 05 June 2014 - 03:35 PM

Found this siggraph crytek paper from last year. http://www.crytek.com/download/Playing%20with%20Real-Time%20Shadows.pdf

 

They are talking about shadows in general and there is a tiny little section about screen space self shadowing that seems to use this technique.

As a screen space technique it's not a drop-in replacement for regular shadow maps, really just an addon to increase fidelity.

 

I can imagine it working pretty well for range restricted point lights though.

 

Are you using deferred lighting? Then it should be a pretty straight forward to incorporate the tracing into the rendering of the point light polygons.




#5158382 [updated]: Make certain objects arrive in the scene (a lorry)

Posted by Madhed on 05 June 2014 - 07:33 AM

so you have a list of trucks that arrive after a specified amount of minutes plus or minus a random amount of minutes. And you want to take the next truck out of this list when the amount of minutes has passed.

 

Is this correct?




#5157531 Is working in terminal/console really a waste of time?

Posted by Madhed on 02 June 2014 - 07:34 AM

The good thing about coding for the console is that you don't need to include dozens of huge confusing libraries when starting out. You can focus on learning algorithms and data structures.

 

As Promit pointed out, console programs can be quite useful. Especially when you need some custom tools in your production pipeline.






PARTNERS