Revision: 19422
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19422
Author:   dfelinto
Date:     2009-03-27 07:05:49 +0100 (Fri, 27 Mar 2009)

Log Message:
-----------
merge with trunk (scons fix and others)
+
Spherical Panoramic (mode 3) working 100% for resolution bigger than 5.
Shadow problems fixed.
More cleanup in the code.

Modified Paths:
--------------
    branches/ge_dome/SConstruct
    branches/ge_dome/config/win32-vc-config.py
    branches/ge_dome/source/blender/render/intern/source/convertblender.c
    branches/ge_dome/source/gameengine/Ketsji/KX_Dome.cpp
    branches/ge_dome/source/gameengine/Ketsji/KX_Dome.h
    branches/ge_dome/source/gameengine/Ketsji/KX_IpoActuator.cpp
    branches/ge_dome/source/gameengine/Ketsji/KX_IpoActuator.h
    branches/ge_dome/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
    branches/ge_dome/source/gameengine/Ketsji/KX_PythonInit.cpp
    branches/ge_dome/source/gameengine/PyDoc/KX_IpoActuator.py
    branches/ge_dome/source/nan_definitions.mk

Modified: branches/ge_dome/SConstruct
===================================================================
--- branches/ge_dome/SConstruct 2009-03-26 20:17:05 UTC (rev 19421)
+++ branches/ge_dome/SConstruct 2009-03-27 06:05:49 UTC (rev 19422)
@@ -557,14 +557,14 @@
        if env['WITH_BF_ICONV']:
                dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
        if env['WITH_BF_FFMPEG']:
-               dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-51.dll',
+               dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll',
                                                
'${LCGDIR}/ffmpeg/lib/avformat-52.dll',
                                                
'${LCGDIR}/ffmpeg/lib/avdevice-52.dll',
-                                               
'${LCGDIR}/ffmpeg/lib/avutil-49.dll',
-                                               
'${LCGDIR}/ffmpeg/lib/libfaad-0.dll',
+                                               
'${LCGDIR}/ffmpeg/lib/avutil-50.dll',
+                                               
'${LCGDIR}/ffmpeg/lib/libfaad-2.dll',
                                                
'${LCGDIR}/ffmpeg/lib/libfaac-0.dll',
                                                
'${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll',
-                                               
'${LCGDIR}/ffmpeg/lib/libx264-59.dll',
+                                               
'${LCGDIR}/ffmpeg/lib/libx264-67.dll',
                                                
'${LCGDIR}/ffmpeg/lib/xvidcore.dll',
                                                
'${LCGDIR}/ffmpeg/lib/swscale-0.dll']
        windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)

Modified: branches/ge_dome/config/win32-vc-config.py
===================================================================
--- branches/ge_dome/config/win32-vc-config.py  2009-03-26 20:17:05 UTC (rev 
19421)
+++ branches/ge_dome/config/win32-vc-config.py  2009-03-27 06:05:49 UTC (rev 
19422)
@@ -9,7 +9,7 @@
 BF_FFMPEG = LIBDIR +'/ffmpeg'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
-BF_FFMPEG_LIB = 'avformat-52.lib avcodec-51.lib avdevice-52.lib avutil-49.lib 
swscale-0.lib'
+BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib 
swscale-0.lib'
 
 BF_PYTHON = LIBDIR + '/python'
 BF_PYTHON_VERSION = '2.5'

Modified: branches/ge_dome/source/blender/render/intern/source/convertblender.c
===================================================================
--- branches/ge_dome/source/blender/render/intern/source/convertblender.c       
2009-03-26 20:17:05 UTC (rev 19421)
+++ branches/ge_dome/source/blender/render/intern/source/convertblender.c       
2009-03-27 06:05:49 UTC (rev 19422)
@@ -1988,12 +1988,12 @@
                                                                        
part->bb_align,part->draw&PART_DRAW_BB_LOCK,
                                                                        
a,totpart+totchild,part->bb_uv_split,part->bb_anim,part->bb_split_offset,random,pa_time,part->bb_offset,uv);
                        }
-                       else if(strandbuf) {
+                       else if(strandbuf) { if(svert) {
                                VECCOPY(svert->co, loc);
                                svert->strandco= -1.0f + 2.0f*time;
                                svert++;
                                strand->totvert++;
-                       }
+                       } }
                        else{
                                if(k==1){
                                        VECSUB(loc0,loc1,loc);

Modified: branches/ge_dome/source/gameengine/Ketsji/KX_Dome.cpp
===================================================================
--- branches/ge_dome/source/gameengine/Ketsji/KX_Dome.cpp       2009-03-26 
20:17:05 UTC (rev 19421)
+++ branches/ge_dome/source/gameengine/Ketsji/KX_Dome.cpp       2009-03-27 
06:05:49 UTC (rev 19422)
@@ -93,7 +93,7 @@
                                cubeleft.resize(2);
                                cuberight.resize(2);
 
-                               CreateMeshDome180(m_resolution);
+                               CreateMeshDome180();
                                m_numfaces = 4;
                        }else if (m_angle > 180 && m_angle <= 250){
                                cubetop.resize(2);
@@ -102,7 +102,7 @@
                                cubefront.resize(2);
                                cuberight.resize(2);
 
-                               CreateMeshDome250(m_resolution);
+                               CreateMeshDome250();
                                m_numfaces = 5;
                        }else{
                                cubetop.resize(2);
@@ -112,7 +112,7 @@
                                cuberight.resize(2);
                                cubeback.resize(2);
 
-                               CreateMeshDome250(m_resolution);
+                               CreateMeshDome250();
                                m_numfaces = 6;
                        }
                        break;
@@ -123,7 +123,7 @@
                        cuberight.resize(2);
 
                        m_angle = 180;
-                       CreateMeshDome180(m_resolution);
+                       CreateMeshDome180();
                        m_numfaces = 4;
                        break;
                case DOME_PANORAM_SPH:
@@ -131,10 +131,12 @@
                        cubeleftback.resize(2);
                        cuberight.resize(2);
                        cuberightback.resize(2);
+                       cubetop.resize(2);
+                       cubebottom.resize(2);
 
                        m_angle = 360;
                        CreateMeshPanorama();
-                       m_numfaces = 4;
+                       m_numfaces = 6;
                        break;
                case DOME_OFFSET:
                        //the same as DOME_FISHEYE > 250\xBA
@@ -147,7 +149,7 @@
 
 //             m_offset = 0.99;
                        m_angle = 360;
-                       CreateMeshDome250(m_resolution);
+                       CreateMeshDome250();
                        m_numfaces = 6;
                        break;
                default: // temporary
@@ -248,23 +250,31 @@
                        }
                }
                else if (m_mode == DOME_PANORAM_SPH){
+
                        glNewList(dlistId, GL_COMPILE);
+                               GLDrawTriangles(cubetop, nfacestop);
+                       glEndList();
+
+                       glNewList(dlistId+1, GL_COMPILE);
+                               GLDrawTriangles(cubebottom, nfacesbottom);
+                       glEndList();
+
+                       glNewList(dlistId+2, GL_COMPILE);
                                GLDrawTriangles(cubeleft, nfacesleft);
                        glEndList();
 
-                       glNewList(dlistId+1, GL_COMPILE);
+                       glNewList(dlistId+3, GL_COMPILE);
                                GLDrawTriangles(cuberight, nfacesright);
                        glEndList();
 
-                       glNewList(dlistId+3, GL_COMPILE);
+                       glNewList(dlistId+4, GL_COMPILE);
                                GLDrawTriangles(cubeleftback, nfacesleftback);
                        glEndList();
 
-                       glNewList(dlistId+2, GL_COMPILE);
+                       glNewList(dlistId+5, GL_COMPILE);
                                GLDrawTriangles(cuberightback, nfacesrightback);
                        glEndList();
                }
-
                //clearing the vectors 
                cubetop.clear();
                cubebottom.clear();
@@ -291,7 +301,7 @@
                }
        glEnd();
 }
-void KX_Dome::CreateMeshDome180(int cubeRes)
+void KX_Dome::CreateMeshDome180(void)
 {
 /*
 1)-  Define the faces of half of a cube 
@@ -372,6 +382,7 @@
        cubeleft[0].u[2] = 0.0;
        cubeleft[0].v[2] = uv_ratio;
 
+       //second triangle
        cubeleft[1].verts[0][0] = -sqrt_2 / 2.0;
        cubeleft[1].verts[0][1] = 0.0;
        cubeleft[1].verts[0][2] = 0.5;
@@ -411,6 +422,7 @@
        cuberight[0].u[2] = uv_ratio;
        cuberight[0].v[2] = uv_ratio;
 
+       //second triangle
        cuberight[1].verts[0][0] = 0.0;
        cuberight[1].verts[0][1] = sqrt_2 / 2.0;
        cuberight[1].verts[0][2] = -0.5;
@@ -434,7 +446,7 @@
        //Refine a triangular mesh by bisecting each edge forms 3 new triangles 
for each existing triangle on each iteration
        //Could be made more efficient for drawing if the triangles were 
ordered in a fan. Not that important since we are using DisplayLists
 
-       for(i=0;i<cubeRes;i++){
+       for(i=0;i<m_resolution;i++){
                cubetop.resize(4*nfacestop);
                SplitFace(cubetop,&nfacestop);
                cubebottom.resize(4*nfacesbottom);
@@ -469,7 +481,7 @@
 
 }
 
-void KX_Dome::CreateMeshDome250(int resolution)
+void KX_Dome::CreateMeshDome250(void)
 {
 /*
 1)-  Define the faces of a cube without the back face
@@ -701,7 +713,7 @@
 
        nfacesbottom = 2;
 
-       if(m_angle > 250){
+       if(m_angle > 250){ //not using
        
                cubeback[0].verts[0][0] = 1.0;
                cubeback[0].verts[0][1] =-1.0;
@@ -746,7 +758,7 @@
        //Refine a triangular mesh by bisecting each edge forms 3 new triangles 
for each existing triangle on each iteration
        //It could be made more efficient for drawing if the triangles were 
ordered in a strip!
 
-       for(i=0;i<resolution;i++){
+       for(i=0;i<m_resolution;i++){
                cubefront.resize(4*nfacesfront);
                SplitFace(cubefront,&nfacesfront);
                cubetop.resize(4*nfacestop);
@@ -762,6 +774,7 @@
                        SplitFace(cubeback,&nfacesback);
                }
        }
+/*
        if(m_mode == DOME_OFFSET){ // double the resolution of the top (front)
                        cubefront.resize(4*nfacesfront);
                        SplitFace(cubefront,&nfacesfront);
@@ -849,14 +862,90 @@
 */
        int i,j;
        float uv_ratio;
-//     float verts_height;
-//     float rad_ang = m_angle * MT_PI / 180.0;
        float sqrt_2 = sqrt(2.0);
-//     verts_height = tan((rad_ang/2) - (MT_PI/2));//for 180 - M_PI/2 for 270 
- 
 
        uv_ratio = (float)m_buffersize / m_imagesize;
-       printf("uv_ratio: %4.2f\n", uv_ratio);//XXX
 
+       /* Top face - two triangles */
+       cubetop[0].verts[0][0] = -sqrt_2;
+       cubetop[0].verts[0][1] = 0.0;
+       cubetop[0].verts[0][2] = 1.0;
+       cubetop[0].u[0] = 0.0;
+       cubetop[0].v[0] = uv_ratio;
+
+       cubetop[0].verts[1][0] = 0.0;
+       cubetop[0].verts[1][1] = sqrt_2;
+       cubetop[0].verts[1][2] = 1.0;
+       cubetop[0].u[1] = 0.0;
+       cubetop[0].v[1] = 0.0;
+
+       //second triangle
+       cubetop[0].verts[2][0] = sqrt_2;
+       cubetop[0].verts[2][1] = 0.0;
+       cubetop[0].verts[2][2] = 1.0;
+       cubetop[0].u[2] = uv_ratio;
+       cubetop[0].v[2] = 0.0;
+
+       cubetop[1].verts[0][0] = sqrt_2;
+       cubetop[1].verts[0][1] = 0.0;
+       cubetop[1].verts[0][2] = 1.0;
+       cubetop[1].u[0] = uv_ratio;
+       cubetop[1].v[0] = 0.0;
+
+       cubetop[1].verts[1][0] = 0.0;
+       cubetop[1].verts[1][1] = -sqrt_2;
+       cubetop[1].verts[1][2] = 1.0;
+       cubetop[1].u[1] = uv_ratio;
+       cubetop[1].v[1] = uv_ratio;
+
+       cubetop[1].verts[2][0] = -sqrt_2;
+       cubetop[1].verts[2][1] = 0.0;
+       cubetop[1].verts[2][2] = 1.0;
+       cubetop[1].u[2] = 0.0;
+       cubetop[1].v[2] = uv_ratio;
+
+       nfacestop = 2;
+
+       /* Bottom face - two triangles */
+       cubebottom[0].verts[0][0] = -sqrt_2;
+       cubebottom[0].verts[0][1] = 0.0;
+       cubebottom[0].verts[0][2] = -1.0;
+       cubebottom[0].u[0] = uv_ratio;
+       cubebottom[0].v[0] = 0.0;
+
+       cubebottom[0].verts[1][0] = sqrt_2;
+       cubebottom[0].verts[1][1] = 0.0;
+       cubebottom[0].verts[1][2] = -1.0;
+       cubebottom[0].u[1] = 0.0;
+       cubebottom[0].v[1] = uv_ratio;
+
+       cubebottom[0].verts[2][0] = 0.0;
+       cubebottom[0].verts[2][1] = sqrt_2;
+       cubebottom[0].verts[2][2] = -1.0;
+       cubebottom[0].u[2] = 0.0;
+       cubebottom[0].v[2] = 0.0;
+
+       //second triangle
+       cubebottom[1].verts[0][0] = sqrt_2;
+       cubebottom[1].verts[0][1] = 0.0;
+       cubebottom[1].verts[0][2] = -1.0;
+       cubebottom[1].u[0] = 0.0;
+       cubebottom[1].v[0] = uv_ratio;
+
+       cubebottom[1].verts[1][0] = -sqrt_2;
+       cubebottom[1].verts[1][1] = 0.0;
+       cubebottom[1].verts[1][2] = -1.0;
+       cubebottom[1].u[1] = uv_ratio;
+       cubebottom[1].v[1] = 0.0;
+
+       cubebottom[1].verts[2][0] = 0.0;
+       cubebottom[1].verts[2][1] = -sqrt_2;
+       cubebottom[1].verts[2][2] = -1.0;
+       cubebottom[1].u[2] = uv_ratio;
+       cubebottom[1].v[2] = uv_ratio;
+
+       nfacesbottom = 2;
+
        /* Left Back (135\xBA) face - two triangles */
 
        cubeleftback[0].verts[0][0] = 0;
@@ -877,6 +966,7 @@
        cubeleftback[0].u[2] = 0;
        cubeleftback[0].v[2] = uv_ratio;
 
+       //second triangle
        cubeleftback[1].verts[0][0] = 0;
        cubeleftback[1].verts[0][1] = -sqrt_2;
        cubeleftback[1].verts[0][2] = 1.0;
@@ -917,6 +1007,7 @@
        cubeleft[0].u[2] = 0;
        cubeleft[0].v[2] = uv_ratio;
 
+       //second triangle
        cubeleft[1].verts[0][0] = -sqrt_2;
        cubeleft[1].verts[0][1] = 0;
        cubeleft[1].verts[0][2] = 1.0;
@@ -956,6 +1047,7 @@
        cuberight[0].u[2] = uv_ratio;
        cuberight[0].v[2] = uv_ratio;
 
+       //second triangle
        cuberight[1].verts[0][0] = 0;
        cuberight[1].verts[0][1] = sqrt_2;
        cuberight[1].verts[0][2] = -1.0;
@@ -995,6 +1087,7 @@
        cuberightback[0].u[2] = uv_ratio;
        cuberightback[0].v[2] = uv_ratio;
 
+       //second triangle
        cuberightback[1].verts[0][0] = sqrt_2;
        cuberightback[1].verts[0][1] = 0;
        cuberightback[1].verts[0][2] = -1.0;
@@ -1025,6 +1118,10 @@
                SplitFace(cubeleftback,&nfacesleftback);
                cuberightback.resize(4*nfacesrightback);

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to