convert vector* to float

Discussion in 'C++' started by ahso, Dec 31, 2011.

  1. ahso

    ahso Guest

    Hi
    I get:
    cannot convert MProbeInfo_t*’ to ‘GLfloat’
    How could I do such?
    Many thanks
    Michael
     
    ahso, Dec 31, 2011
    #1
    1. Advertising

  2. Hi Michael

    ahso wrote:

    > Hi
    > I get:
    > cannot convert MProbeInfo_t*’ to ‘GLfloat’
    > How could I do such?


    You need to explain some more, as it doesn't make much sense to
    convert a pointer to a floating point number.

    Best regards
    Asger-P
     
    Asger Joergensen, Dec 31, 2011
    #2
    1. Advertising

  3. ahso

    ahso Guest

    I want to use it with glVertex3f and I get values like altitude from
    that vector:

    glVertex3f(lx+1059, ly+749, ProbeResultat)->locZ);

    it's declared as:
    std::vector<Probe_t*> ProbeResultat;

    Many thanks
     
    ahso, Dec 31, 2011
    #3
  4. On 12/31/2011 9:13 AM, ahso wrote:
    > I want to use it with glVertex3f and I get values like altitude from
    > that vector:
    >
    > glVertex3f(lx+1059, ly+749, ProbeResultat)->locZ);
    >
    > it's declared as:
    > std::vector<Probe_t*> ProbeResultat;
    >
    > Many thanks


    So, the expression 'ProbeResultat' yields 'a pointer to Probe_t'.
    The third argument of 'glVertex3f' (I'm guessing here, OpenGL is not
    defined by C++ language), is the 'GLfloat' that you have a problem with,
    right? Count the parentheses.

    V
    --
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Dec 31, 2011
    #4
  5. Hi ahso

    ahso wrote:

    > I want to use it with glVertex3f and I get values like altitude from
    > that vector:
    >
    > glVertex3f(lx+1059, ly+749, ProbeResultat)->locZ);


    You have an extra ) right before ->
    try this instead:
    glVertex3f( lx+1059, ly+749, ProbeResultat->locZ );

    what type is Probe_t::locZ ?

    Best regards
    Asger-P
     
    Asger Joergensen, Dec 31, 2011
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pepijn Kenter
    Replies:
    2
    Views:
    8,722
    Pepijn Kenter
    Aug 16, 2004
  2. bd
    Replies:
    0
    Views:
    672
  3. Replies:
    10
    Views:
    650
    Clark S. Cox III
    Sep 1, 2005
  4. Replies:
    8
    Views:
    2,004
    Csaba
    Feb 18, 2006
  5. Carsten Fuchs
    Replies:
    45
    Views:
    1,660
    James Kanze
    Oct 8, 2009
Loading...

Share This Page