Changeset 1298 for trunk


Ignore:
Timestamp:
Mar 7, 2009, 1:38:45 PM (16 years ago)
Author:
vrinside
Message:

fixed the location of particles

Location:
trunk/packages/vizservers/nanovis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Command.cpp

    r1295 r1298  
    19971997    }
    19981998    if (NanoVis::particleRenderer != NULL) {
    1999         NanoVis::particleRenderer->setVectorField(volPtr->id, 1.0f,
     1999        NanoVis::particleRenderer->setVectorField(volPtr->id,
     2000            *(volPtr->get_location()),
     2001            1.0f,
    20002002            volPtr->height / (float)volPtr->width,
    20012003            volPtr->depth  / (float)volPtr->width,
  • trunk/packages/vizservers/nanovis/NvParticleRenderer.cpp

    r1111 r1298  
    2828
    2929NvParticleRenderer::NvParticleRenderer(int w, int h, CGcontext context)
    30     : scale(1, 1, 1), _activate(false)
     30    : scale(1, 1, 1), _activate(false), origin(0, 0, 0)
    3131{
    3232    psys_width = w;
     
    261261    glPushMatrix();
    262262
     263    glTranslatef(origin.x, origin.y, origin.z);
    263264    glScaled(scale.x, scale.y, scale.z);
    264265
     
    275276}
    276277
    277 void NvParticleRenderer::setVectorField(unsigned int texID, float scaleX, float scaleY, float scaleZ, float max)
    278 {
     278void NvParticleRenderer::setVectorField(unsigned int texID, const Vector3& ori, float scaleX, float scaleY, float scaleZ, float max)
     279{
     280    origin = ori;
    279281    scale.set(scaleX, scaleY, scaleZ);
    280282    _advectionShader->setScale(scale);
  • trunk/packages/vizservers/nanovis/NvParticleRenderer.h

    r1053 r1298  
    9393    Vector3 scale;
    9494
     95    Vector3 origin;
     96
    9597    bool _activate;
    9698public:
     
    100102    NvParticleRenderer(int w, int h, CGcontext context);
    101103    ~NvParticleRenderer();
    102     void setVectorField(unsigned int texID, float scaleX, float scaleY, float scaleZ, float max);
     104    void setVectorField(unsigned int texID, const Vector3& ori, float scaleX, float scaleY, float scaleZ, float max);
    103105    void initialize(Particle* data);
    104106    void advect();
Note: See TracChangeset for help on using the changeset viewer.