3D Reflection and 3DSelection

Developed or developing a new product in PureBasic? Tell the world about it.
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

3D Reflection and 3DSelection

Post 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 ;)
bye,
Daniel
PolyVector
Enthusiast
Enthusiast
Posts: 499
Joined: Wed Sep 17, 2003 9:17 pm
Location: Southern California
Contact:

Post by PolyVector »

Nice, it worked perfect here :)
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

Worked fine here, nice :)
Mark my words, when you least expect it, your uppance will come...
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post 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..)
~Dreglor
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Uhm, well, maybe your card doesn't support StencilBuffer really good. Have you checked a newer version of your card-driver?
bye,
Daniel
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

@DarkDragon:
Runs fine here with WinXP / GeForceMX4 440 :!:

Especially liked the Reflections-Demo ... nice work.
regards,
benny!
-
pe0ple ar3 str4nge!!!
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post 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
~Dreglor
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

really good examples. it runs totally fine on my "radeon 9600 XT 256 mb ddr"
Christian
Enthusiast
Enthusiast
Posts: 154
Joined: Mon Dec 08, 2003 7:50 pm
Location: Germany

Post 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
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post 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.
bye,
Daniel
Christian
Enthusiast
Enthusiast
Posts: 154
Joined: Mon Dec 08, 2003 7:50 pm
Location: Germany

Post by Christian »

Thank you, works fine now.

regards,
Christian
Post Reply