Java-Gaming.org
Java4K winners:
[
by our judges
|
by the community
]
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members
News
: Read the
Java Gaming Resources
, or peek at
the official Java tutorials
Home
Help
Search
Login
Register
Java-Gaming.org
>
Game Development
>
Newbie & Debugging Questions
>
glNormalPointer
Pages: [
1
]
Print
glNormalPointer
(Read 2345 times)
0 Members and 1 Guest are viewing this topic.
Mojomonkey
JGO Ninja
Posts: 540
Medals: 3
ooh ooh eee eeee
glNormalPointer
«
on:
2003-10-31 06:09:51
»
Ok, this probably a simple problem, but I'm having trouble wrapping my head around it.
I understand that if I have a complex model I have my vertex array and my normal array (as well as texture, color etc). Each normal entry corresponds to a vertex. That's fine, I understand that....
but, now I have a simple box. 6 vertices. However, each vertex has three possible normals (where the normal depends on which side I'm rendering.)
Is this not doable using pointers? Do I need to seperate my box into 6 seperate sides and render them independantly?
Don't send a man to do a monkey's work.
Orangy Tang
JGO Kernel
Posts: 2960
Medals: 37
Monkey for a head
Re: glNormalPointer
«
Reply #1 on:
2003-10-31 06:29:01
»
A box is about the worst possible case for vertex arrays since you've got plenty of shared vertices but no shared normals. The only way to do it is to duplicate your vertices so you end up with 4 vertices and 4 associated normals for each face. Theres no pointer magic you can do to get around this, since GL will just read the data in in continuous blocks.
It would be nice to have separate indices for vertex, normal, texture coords etc. but I don't think that'd be as hardware friendly for caching. Plus you'd have so many more indices the actual data to move around would greatly increase.
[
TriangularPixels.com
- Play Growth Spurt, Rescue Squad and Snowman Village ] [
Rebirth - game resource library
]
princec
« League of Dukes »
JGO Kernel
Posts: 8086
Medals: 94
Eh? Who? What? ... Me?
Re: glNormalPointer
«
Reply #2 on:
2003-10-31 07:10:48
»
And when you delve deeper into 3D rendering you'll gradually realise why there is no sensible way to specify the vertex coordinates just once and the normals separately 3 times.
Cas
Play Revenge of the Titans
-
Play Titan Attacks
-
Play Droid Assault
Pages: [
1
]
Print
Jump to:
Please select a destination:
-----------------------------
Games Center
-----------------------------
=> Featured Games
=> Showcase
=> Contests
===> LWJGL16k - 2011
===> 4K Game Competition - 2012
===> JGO Comp Petite
===> Finished Contests
=====> 4K Game Competition - 2011
=====> 4K Game Competition - 2010
=====> 4K Game Competition - 2009
=====> 4K Game Competition - 2008
=====> 4K Game Competition - 2007
=====> 4K Game Competition - 2006
=====> 4K Game Competition - 2005
=====> Tiny Game 2010
=====> JGO Comp 2009
=====> 16K LWJGL Competition - 2005
=====> Java Technology Game Development Contest - 2004
-----------------------------
Discussions
-----------------------------
=> General Discussions
===> Suggestions
=> Business and Project Discussions
===> Jobs and Resumes
===> Community & Volunteer Projects
=> Miscellaneous Topics
-----------------------------
Game Development
-----------------------------
=> Newbie & Debugging Questions
=> Articles & tutorials
=> Game Play & Game Design
=> Game Mechanics
===> Artificial Intelligence
=> Networking & Multiplayer
=> Performance Tuning
=> Shared Code
-----------------------------
Java Game APIs & Engines
-----------------------------
=> Engines, Libraries and Tools
===> Java 3D
===> JInput
===> jMonkeyEngine
===> Xith3D Forums
===> Tools Discussion
=> Java 2D
===> JavaFX
=> OpenGL Development
===> JOGL Development
===> LWJGL Development
=> Java Sound & OpenAL
===> JOAL Development
=> Java on Mobile Devices
===> Android
===> J2ME
Loading...