Results 1 to 3 of 3

Thread: should i use vertex arrays???

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    san diego,CA,usa
    Posts
    1

    should i use vertex arrays???

    I'm working on making a 3-D room, to experiement with lighting and objects and I've been using a generic makeWall (l,w,h) function that takes the dimensions of the desired cubic object and then draws them with some texture coordinates. I've recently run into the problem of using spotlights, because I don't have enough vertices to get the desired effect of actually seing the spotlight on the wall rather than seeing the whole wall light up. I've been trying to figure out a way to add more verticies and polygons to the wall. I've been thinking of using a struct, but then got to figuring that it wouldn't help me as much due to the amount of different information i'd have to store. I've been reading some of your guys's posts and have been wondering if i should use vertex arrays. I don't know anything about them or what openGL functions use them, so i'd appreciate any and all suggestions. Thanks!

  2. #2
    Senior Member Regular Contributor
    Join Date
    May 2001
    Location
    London UK
    Posts
    195

    Re: should i use vertex arrays???

    You need a book like the red book. It can be downloaded from gamedev but it is better to buy it since you get the latest edition.

  3. #3
    Member Newbie
    Join Date
    Dec 2000
    Location
    Canada
    Posts
    34

    Re: should i use vertex arrays???

    I would strongly suggest ordering the red book - it's useful for solving problems, and is a good learning text as well.

    As to your vertex array - that is just one way of creating your room's walls.

    Instead of a cube, draw six quads. If you want a spotlight on a wall, it needs more vertices, as you noted. You could write a function to subdivide the quad. Pass in the corners, and it could create as many sub-sections as you like, based on performance vs visual appeal trade offs.

    To do this, you would have to specify the normals for all the vertices - if you don't know how to do that, the red book is the best place to look.

    cheers,
    Andrew

    [This message has been edited by outlander78 (edited 03-23-2001).]

Similar Threads

  1. arrays of arrays as vertex output/fragment input
    By tsojtsoj in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-17-2018, 08:02 PM
  2. Vertex Arrays, interleaved arrays, mouseMove func
    By Nibirue in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-13-2012, 11:17 AM
  3. Big problem show arrays with vertex arrays
    By Rondey in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 03-15-2009, 10:09 AM
  4. Vertex Arrays: Interleaved or seperated arrays?
    By Jan in forum OpenGL: Advanced Coding
    Replies: 16
    Last Post: 06-21-2005, 05:25 AM
  5. Vertex arrays and ... texture arrays
    By cix>foo in forum OpenGL: Advanced Coding
    Replies: 21
    Last Post: 06-25-2000, 08:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean