Search:

Type: Posts; User: Geometrian

Search: Search took 0.01 seconds.

  1. Ahhh. Can you suggest some? Ideally, I'd like...

    Ahhh. Can you suggest some? Ideally, I'd like something simple and lightweight.Yes, this is C++. I posted in C++ because I didn't want to exclude any potential C++ solutions. I had considered...
  2. Basic Cross-Platform Console Formatting Function

    Hi,

    I'm trying to write a function that prints text to the console in a custom format. I'm trying to make it cross-platform, and I am developing on Windows. Right now, all I really care about is...
  3. Replies
    8
    Views
    2,054

    Thanks. I see why that's necessary now; deleting...

    Thanks. I see why that's necessary now; deleting via a pointer to the base class shouldn't work as expected--in any case, I wouldn't expect the derived class's destructor to be called.

    Thanks...
  4. Replies
    8
    Views
    2,054

    Well, alrighty. I'm gonna post the minimum...

    Well, alrighty. I'm gonna post the minimum required to understand the code. Here goes.

    glLibView.h/glLibView.cpp:
    class glLibInternal_glLibView {
    private:
    glLibMathMatrix<float>* _matrix;...
  5. Replies
    8
    Views
    2,054

    Mmm yep. Pseudocode error. Fixed.That's what I...

    Mmm yep. Pseudocode error. Fixed.That's what I was thinking. So why isn't it?
  6. Replies
    8
    Views
    2,054

    Destructor not being Called

    Hi,

    Pseudocode of architecture:
    class class2 {
    private:
    float* class_array;
    public:
    class2() { class_array = new float[10]; }
    ~class2() { delete []...
  7. Replies
    5
    Views
    1,509

    Huh. Could have sworn I'd tried that, but...

    Huh. Could have sworn I'd tried that, but evidently I didn't. Thanks,
  8. Replies
    5
    Views
    1,509

    List of new-ed Pointers

    Hi,

    I have a standard list<my_obj*> and I need to iterate through it and remove all the objects that have a certain parameter my_obj.time>1.0f.

    I've tried a number of things, but _Crt keeps...
  9. Replies
    19
    Views
    8,956

    It depends. Generally speaking, raw datas'...

    It depends. Generally speaking, raw datas' parameters should be normalized (i.e., your object data should have normalized geometry). When rendering, some things can mess this up--e.g. scaling,...
  10. Replies
    17
    Views
    7,937

    Ah thanks; I was wondering why it was working. ...

    Ah thanks; I was wondering why it was working. I've changed everything over to use std::string now.

    Thanks again, everyone.
  11. Replies
    19
    Views
    8,956

    If you normalize the two vectors, (length = 1),...

    If you normalize the two vectors, (length = 1), then dot them, you'll get a right triangle. The dot product is the projection of the vectors onto each other.

    So,...
  12. Replies
    19
    Views
    8,956

    You can extend this to find the angle between two...

    You can extend this to find the angle between two planes, by finding the angle between their normals. Also note that if you abs() the result of the dot product in the numerator, you can get the...
  13. Replies
    17
    Views
    7,937

    std::map of char* keys

    Hi,

    Does it make sense to have a std::map<char*,blah>? It seems to me that string literals' pointers would be compared instead of the strings themselves, as would normally happen for char* str1...
  14. Replies
    3
    Views
    2,405

    Allocations in Loops

    Hi,

    Simple question I've always wondered about:

    Program 1:
    for (int i=0;i<400;i++) {
    float value = my_array[i];
    //do something with value
    }Program 2:
    float value;
  15. Replies
    6
    Views
    3,727

    In OpenGL, it would probably just be GL_LINEAR...

    In OpenGL, it would probably just be GL_LINEAR (especially for magnification, where that's the only choice). But as I said, I'm concerned that casting the bool to an int might interfere with other...
  16. Replies
    6
    Views
    3,727

    Hi, You're right, I probably should explain...

    Hi,

    You're right, I probably should explain some of the context of the problem. The function is the constructor for a two-dimensional texture in an OpenGL utility library.

    There are a whole...
  17. Replies
    6
    Views
    3,727

    Best C++ Function Prototype

    Hi,

    I'm working on improving my C++ skills. I'm porting over a Python library I wrote to C++. There's a function in the library, and I'm wondering how best to represent the function's arguments...
  18. Replies
    3
    Views
    2,304

    It's was written and is being read in text mode,...

    It's was written and is being read in text mode, not binary mode. It needs to be human readable.
  19. Replies
    3
    Views
    2,304

    Loading a File

    Hi,

    I'm trying to load a text file very quickly. My test file is 630KB. Presently, I'm trying to find the fastest algorithm that works. For testing purposes, all processing has been removed;...
Results 1 to 19 of 19