Page 1 of 1

3D Reflection and 3DSelection

Posted: Mon Sep 06, 2004 5:19 pm
by DarkDragon
Hey PBUsers:

I have new pureopengl examples for you. http://www.bradan.net/downloads/demo002.zip

There is a 3DSelection code(If you want to make an 3DEditor) and a Reflection(With stencilbuffer). Maybe I can make new tutorials after my next version of my 3DEngine for you.

Feedback please ;)

Posted: Mon Sep 06, 2004 10:18 pm
by PolyVector
Nice, it worked perfect here :)

Posted: Mon Sep 06, 2004 11:30 pm
by Moonshine
Worked fine here, nice :)

Posted: Tue Sep 07, 2004 12:41 am
by Dreglor
it may be my card but are the reflections program seams super slow (how fast cube should it spin?) it moves hardly and jumps some times
i have a 9100 (hey don't laugh it can doom3 at avg 20 fps..)

Posted: Tue Sep 07, 2004 6:37 am
by DarkDragon
Uhm, well, maybe your card doesn't support StencilBuffer really good. Have you checked a newer version of your card-driver?

Posted: Tue Sep 07, 2004 6:25 pm
by benny
@DarkDragon:
Runs fine here with WinXP / GeForceMX4 440 :!:

Especially liked the Reflections-Demo ... nice work.

Posted: Tue Sep 07, 2004 6:35 pm
by Dreglor
DarkDragon wrote:Uhm, well, maybe your card doesn't support StencilBuffer really good. Have you checked a newer version of your card-driver?
it the newest one i jkust downloaded it a week ago

Posted: Tue Sep 07, 2004 7:40 pm
by thefool
really good examples. it runs totally fine on my "radeon 9600 XT 256 mb ddr"

Posted: Sat Sep 18, 2004 8:52 pm
by Christian
Hi!

Nice example! Works well on my "Matrox Millenium G550 32MB DDR".

But I've got a question about the LoadTexture_() procedure. Why is every texture loaded with this procedure vertical turned? Is it possible to load it in the right way?

Thanks!

Regards,
Christian

Posted: Sun Sep 19, 2004 11:28 am
by DarkDragon

Code: Select all

Procedure LoadTexture_(Filename.s, TexFilter.l) ; Returns the texture for an OpenGL application
  img = LoadImage(#PB_Any, Filename.s)
  Width.l=ImageWidth()
  Height.l=ImageHeight()
  Size.l=Width * Height
  
  Dim ImageData.b(Size*3)
  
  StartDrawing(ImageOutput())
  For Y=Height-1 To 0 Step -1
    For X=0 To Width-1
     
      Color = Point(X,Y)
      ImageData(i)=Red(Color)
      i+1
      ImageData(i)=Green(Color)
      i+1
      ImageData(i)=Blue(Color)
      i+1
    
    Next
  Next
  StopDrawing()
  
  glGenTextures_(1, @Tex) ;Textur speichern
  If TexFilter = 0 ;versch. Textur-Filter
    glBindTexture_($0DE1, Tex)
    glTexParameteri_($0DE1, $2800, $2600)
    glTexParameteri_($0DE1, $2801, $2600)
    glTexImage2D_($0DE1, 0, 6407, Width, Height, 0, 6407, $1401, @ImageData()) 
  ElseIf TexFilter = 1
    glBindTexture_($0DE1, Tex)
    glTexParameteri_($0DE1, $2800, $2601)
    glTexParameteri_($0DE1, $2801, $2601)
    glTexImage2D_($0DE1, 0, 6407, Width, Height, 0, 6407, $1401, @ImageData())
  ElseIf TexFilter = 2
    glBindTexture_($0DE1, Tex)
    glTexParameteri_($0DE1, $2800, $2601)
    glTexParameteri_($0DE1, $2801, $2701)
    gluBuild2DMipmaps_($0DE1, 3, Width, Height, 6407, $1401, @ImageData())
  EndIf
  FreeImage(img)
  ProcedureReturn Tex
EndProcedure
Then it should be right.

[EDIT] Sorry posted the old code.

@Dreglor:
I have no idea, why it doesn't work well at your computer.

Posted: Sat Sep 25, 2004 9:45 am
by Christian
Thank you, works fine now.

regards,
Christian