   glDrawElements - am i correct?
glEnableClientState(GL_VERTEX_ARRAY);glVertexPointer( 3, GL_FLOAT,sizeof(CVector3),pObject->pVerts);glDrawElements(GL_TRIANGLES, (pObject->numOfFaces*3), GL_UNSIGNED_INT, pObject->m_pIndices);glDisableClientState(GL_VERTEX_ARRAY);/*pObject->pVerts- CVector3 holding array of verticespObject->numOfFaces - int holding number of facespObject->m_pIndices - int array holding indices*/Can someone pls shed a light on this - why does this crash my render?   
  Assuming you're still using obj from your other thread, you are probably not using the right indices.Obj defines the first element of an array as "1" while opengl expects the first element to be "0". This means your indices will all be off by 1, and opengl will try to access one vertex past the end of the array and crash.Subtract 1 from all of the indices that you read from your obj, that should work.   ;Quote:Original post by karwostsAssuming you're still using obj from your other thread, you are probably not using the right indices.Obj defines the first element of an array as "1" while opengl expects the first element to be "0". This means your indices will all be off by 1, and opengl will try to access one vertex past the end of the array and crash.Subtract 1 from all of the indices that you read from your obj, that should work.Karwosts - nope :) it is not OBJ, i just gave obj as an example out there in the previous topic. This is my own format and i cannot somehow get it running with VArrays...Have a look below, it should tell you the truth (sorry for a long paste):[source lang=cpp][XYN:LOADER] pVerts=50 textVerts=59 numIndices=288 faces=96[XYN:LOADER] Indice.0=0 [XYN:LOADER] Indice.1=1 [XYN:LOADER] Indice.2=2 [XYN:LOADER] Indice.3=1 [XYN:LOADER] Indice.4=3 [XYN:LOADER] Indice.5=2 [XYN:LOADER] Indice.6=4 [XYN:LOADER] Indice.7=5 [XYN:LOADER] Indice.8=6 [XYN:LOADER] Indice.9=7 [XYN:LOADER] Indice.10=8 [XYN:LOADER] Indice.11=3 [XYN:LOADER] Indice.12=7 [XYN:LOADER] Indice.13=4 [XYN:LOADER] Indice.14=8 [XYN:LOADER] Indice.15=7 [XYN:LOADER] Indice.16=3 [XYN:LOADER] Indice.17=1 [XYN:LOADER] Indice.18=9 [XYN:LOADER] Indice.19=6 [XYN:LOADER] Indice.20=5 [XYN:LOADER] Indice.21=5 [XYN:LOADER] Indice.22=10 [XYN:LOADER] Indice.23=9 [XYN:LOADER] Indice.24=11 [XYN:LOADER] Indice.25=9 [XYN:LOADER] Indice.26=10 [XYN:LOADER] Indice.27=10 [XYN:LOADER] Indice.28=12 [XYN:LOADER] Indice.29=11 [XYN:LOADER] Indice.30=13 [XYN:LOADER] Indice.31=11 [XYN:LOADER] Indice.32=12 [XYN:LOADER] Indice.33=5 [XYN:LOADER] Indice.34=4 [XYN:LOADER] Indice.35=7 [XYN:LOADER] Indice.36=10 [XYN:LOADER] Indice.37=14 [XYN:LOADER] Indice.38=15 [XYN:LOADER] Indice.39=15 [XYN:LOADER] Indice.40=12 [XYN:LOADER] Indice.41=10 [XYN:LOADER] Indice.42=5 [XYN:LOADER] Indice.43=7 [XYN:LOADER] Indice.44=14 [XYN:LOADER] Indice.45=10 [XYN:LOADER] Indice.46=5 [XYN:LOADER] Indice.47=14 [XYN:LOADER] Indice.48=7 [XYN:LOADER] Indice.49=16 [XYN:LOADER] Indice.50=17 [XYN:LOADER] Indice.51=17 [XYN:LOADER] Indice.52=14 [XYN:LOADER] Indice.53=7 [XYN:LOADER] Indice.54=7 [XYN:LOADER] Indice.55=1 [XYN:LOADER] Indice.56=16 [XYN:LOADER] Indice.57=0 [XYN:LOADER] Indice.58=16 [XYN:LOADER] Indice.59=1 [XYN:LOADER] Indice.60=18 [XYN:LOADER] Indice.61=13 [XYN:LOADER] Indice.62=12 [XYN:LOADER] Indice.63=15 [XYN:LOADER] Indice.64=18 [XYN:LOADER] Indice.65=12 [XYN:LOADER] Indice.66=0 [XYN:LOADER] Indice.67=19 [XYN:LOADER] Indice.68=16 [XYN:LOADER] Indice.69=19 [XYN:LOADER] Indice.70=0 [XYN:LOADER] Indice.71=20 [XYN:LOADER] Indice.72=21 [XYN:LOADER] Indice.73=0 [XYN:LOADER] Indice.74=2 [XYN:LOADER] Indice.75=3 [XYN:LOADER] Indice.76=21 [XYN:LOADER] Indice.77=2 [XYN:LOADER] Indice.78=22 [XYN:LOADER] Indice.79=4 [XYN:LOADER] Indice.80=6 [XYN:LOADER] Indice.81=8 [XYN:LOADER] Indice.82=23 [XYN:LOADER] Indice.83=3 [XYN:LOADER] Indice.84=4 [XYN:LOADER] Indice.85=23 [XYN:LOADER] Indice.86=8 [XYN:LOADER] Indice.87=3 [XYN:LOADER] Indice.88=23 [XYN:LOADER] Indice.89=21 [XYN:LOADER] Indice.90=6 [XYN:LOADER] Indice.91=9 [XYN:LOADER] Indice.92=22 [XYN:LOADER] Indice.93=24 [XYN:LOADER] Indice.94=22 [XYN:LOADER] Indice.95=9 [XYN:LOADER] Indice.96=9 [XYN:LOADER] Indice.97=11 [XYN:LOADER] Indice.98=24 [XYN:LOADER] Indice.99=25 [XYN:LOADER] Indice.100=24 [XYN:LOADER] Indice.101=11 [XYN:LOADER] Indice.102=11 [XYN:LOADER] Indice.103=13 [XYN:LOADER] Indice.104=25 [XYN:LOADER] Indice.105=4 [XYN:LOADER] Indice.106=22 [XYN:LOADER] Indice.107=23 [XYN:LOADER] Indice.108=26 [XYN:LOADER] Indice.109=24 [XYN:LOADER] Indice.110=27 [XYN:LOADER] Indice.111=25 [XYN:LOADER] Indice.112=27 [XYN:LOADER] Indice.113=24 [XYN:LOADER] Indice.114=23 [XYN:LOADER] Indice.115=22 [XYN:LOADER] Indice.116=26 [XYN:LOADER] Indice.117=22 [XYN:LOADER] Indice.118=24 [XYN:LOADER] Indice.119=26 [XYN:LOADER] Indice.120=28 [XYN:LOADER] Indice.121=23 [XYN:LOADER] Indice.122=29 [XYN:LOADER] Indice.123=26 [XYN:LOADER] Indice.124=29 [XYN:LOADER] Indice.125=23 [XYN:LOADER] Indice.126=21 [XYN:LOADER] Indice.127=23 [XYN:LOADER] Indice.128=28 [XYN:LOADER] Indice.129=28 [XYN:LOADER] Indice.130=0 [XYN:LOADER] Indice.131=21 [XYN:LOADER] Indice.132=13 [XYN:LOADER] Indice.133=18 [XYN:LOADER] Indice.134=25 [XYN:LOADER] Indice.135=30 [XYN:LOADER] Indice.136=27 [XYN:LOADER] Indice.137=25 [XYN:LOADER] Indice.138=25 [XYN:LOADER] Indice.139=18 [XYN:LOADER] Indice.140=30 [XYN:LOADER] Indice.141=20 [XYN:LOADER] Indice.142=0 [XYN:LOADER] Indice.143=31 [XYN:LOADER] Indice.144=28 [XYN:LOADER] Indice.145=31 [XYN:LOADER] Indice.146=0 [XYN:LOADER] Indice.147=27 [XYN:LOADER] Indice.148=32 [XYN:LOADER] Indice.149=26 [XYN:LOADER] Indice.150=33 [XYN:LOADER] Indice.151=26 [XYN:LOADER] Indice.152=32 [XYN:LOADER] Indice.153=26 [XYN:LOADER] Indice.154=33 [XYN:LOADER] Indice.155=29 [XYN:LOADER] Indice.156=34 [XYN:LOADER] Indice.157=29 [XYN:LOADER] Indice.158=33 [XYN:LOADER] Indice.159=30 [XYN:LOADER] Indice.160=35 [XYN:LOADER] Indice.161=32 [XYN:LOADER] Indice.162=32 [XYN:LOADER] Indice.163=27 [XYN:LOADER] Indice.164=30 [XYN:LOADER] Indice.165=14 [XYN:LOADER] Indice.166=17 [XYN:LOADER] Indice.167=36 [XYN:LOADER] Indice.168=36 [XYN:LOADER] Indice.169=15 [XYN:LOADER] Indice.170=14 [XYN:LOADER] Indice.171=15 [XYN:LOADER] Indice.172=36 [XYN:LOADER] Indice.173=37 [XYN:LOADER] Indice.174=37 [XYN:LOADER] Indice.175=18 [XYN:LOADER] Indice.176=15 [XYN:LOADER] Indice.177=18 [XYN:LOADER] Indice.178=37 [XYN:LOADER] Indice.179=38 [XYN:LOADER] Indice.180=38 [XYN:LOADER] Indice.181=30 [XYN:LOADER] Indice.182=18 [XYN:LOADER] Indice.183=30 [XYN:LOADER] Indice.184=38 [XYN:LOADER] Indice.185=35 [XYN:LOADER] Indice.186=17 [XYN:LOADER] Indice.187=39 [XYN:LOADER] Indice.188=36 [XYN:LOADER] Indice.189=39 [XYN:LOADER] Indice.190=17 [XYN:LOADER] Indice.191=40 [XYN:LOADER] Indice.192=36 [XYN:LOADER] Indice.193=39 [XYN:LOADER] Indice.194=41 [XYN:LOADER] Indice.195=41 [XYN:LOADER] Indice.196=37 [XYN:LOADER] Indice.197=36 [XYN:LOADER] Indice.198=37 [XYN:LOADER] Indice.199=41 [XYN:LOADER] Indice.200=38 [XYN:LOADER] Indice.201=42 [XYN:LOADER] Indice.202=38 [XYN:LOADER] Indice.203=41 [XYN:LOADER] Indice.204=38 [XYN:LOADER] Indice.205=42 [XYN:LOADER] Indice.206=43 [XYN:LOADER] Indice.207=43 [XYN:LOADER] Indice.208=35 [XYN:LOADER] Indice.209=38 [XYN:LOADER] Indice.210=16 [XYN:LOADER] Indice.211=19 [XYN:LOADER] Indice.212=17 [XYN:LOADER] Indice.213=17 [XYN:LOADER] Indice.214=19 [XYN:LOADER] Indice.215=40 [XYN:LOADER] Indice.216=32 [XYN:LOADER] Indice.217=44 [XYN:LOADER] Indice.218=33 [XYN:LOADER] Indice.219=45 [XYN:LOADER] Indice.220=33 [XYN:LOADER] Indice.221=44 [XYN:LOADER] Indice.222=33 [XYN:LOADER] Indice.223=45 [XYN:LOADER] Indice.224=34 [XYN:LOADER] Indice.225=35 [XYN:LOADER] Indice.226=46 [XYN:LOADER] Indice.227=32 [XYN:LOADER] Indice.228=44 [XYN:LOADER] Indice.229=32 [XYN:LOADER] Indice.230=46 [XYN:LOADER] Indice.231=46 [XYN:LOADER] Indice.232=35 [XYN:LOADER] Indice.233=43 [XYN:LOADER] Indice.234=34 [XYN:LOADER] Indice.235=31 [XYN:LOADER] Indice.236=29 [XYN:LOADER] Indice.237=29 [XYN:LOADER] Indice.238=31 [XYN:LOADER] Indice.239=28 [XYN:LOADER] Indice.240=41 [XYN:LOADER] Indice.241=39 [XYN:LOADER] Indice.242=47 [XYN:LOADER] Indice.243=47 [XYN:LOADER] Indice.244=42 [XYN:LOADER] Indice.245=41 [XYN:LOADER] Indice.246=42 [XYN:LOADER] Indice.247=47 [XYN:LOADER] Indice.248=48 [XYN:LOADER] Indice.249=48 [XYN:LOADER] Indice.250=43 [XYN:LOADER] Indice.251=42 [XYN:LOADER] Indice.252=46 [XYN:LOADER] Indice.253=48 [XYN:LOADER] Indice.254=44 [XYN:LOADER] Indice.255=45 [XYN:LOADER] Indice.256=44 [XYN:LOADER] Indice.257=48 [XYN:LOADER] Indice.258=48 [XYN:LOADER] Indice.259=46 [XYN:LOADER] Indice.260=43 [XYN:LOADER] Indice.261=39 [XYN:LOADER] Indice.262=40 [XYN:LOADER] Indice.263=49 [XYN:LOADER] Indice.264=49 [XYN:LOADER] Indice.265=47 [XYN:LOADER] Indice.266=39 [XYN:LOADER] Indice.267=48 [XYN:LOADER] Indice.268=47 [XYN:LOADER] Indice.269=45 [XYN:LOADER] Indice.270=34 [XYN:LOADER] Indice.271=45 [XYN:LOADER] Indice.272=47 [XYN:LOADER] Indice.273=40 [XYN:LOADER] Indice.274=19 [XYN:LOADER] Indice.275=20 [XYN:LOADER] Indice.276=20 [XYN:LOADER] Indice.277=49 [XYN:LOADER] Indice.278=40 [XYN:LOADER] Indice.279=20 [XYN:LOADER] Indice.280=47 [XYN:LOADER] Indice.281=49 [XYN:LOADER] Indice.282=47 [XYN:LOADER] Indice.283=20 [XYN:LOADER] Indice.284=34 [XYN:LOADER] Indice.285=31 [XYN:LOADER] Indice.286=34 [XYN:LOADER] Indice.287=20 VER: 0VER: 1VER: 2VER: 3VER: 4VER: 5VER: 6VER: 7VER: 8VER: 9VER: 10VER: 11VER: 12VER: 13VER: 14VER: 15VER: 16VER: 17VER: 18VER: 19VER: 20VER: 21VER: 22VER: 23VER: 24VER: 25VER: 26VER: 27VER: 28VER: 29VER: 30VER: 31VER: 32VER: 33VER: 34VER: 35VER: 36VER: 37VER: 38VER: 39VER: 40VER: 41VER: 42VER: 43VER: 44VER: 45VER: 46VER: 47VER: 48VER: 49What the heck is wrong?I changed this to:;glEnableClientState(GL_VERTEX_ARRAY);glVertexPointer( 3, GL_FLOAT,sizeof(CVector3),pObject->pVerts);//glDrawElements(GL_TRIANGLES, (pObject->numOfFaces)*3, GL_UNSIGNED_INT,Object->m_pIndices);glDrawArrays( GL_TRIANGLES, 0,(pObject->numOfFaces)*3); glDisableClientState(GL_VERTEX_ARRAY);glDrawArrays instead of DrawElements and it works fine..   ;  got itm_pIndices - was deleted before render.good damn!thanks anyway.   