Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 629281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:43:43+00:00 2026-05-13T19:43:43+00:00

So I have some path generator which now works like this http://www.openprocessing.org/visuals/?visualID=2615 (There is

  • 0

So I have some path generator which now works like this

http://www.openprocessing.org/visuals/?visualID=2615 (There is source; WQRNING – JAVA APPLET)

I want to create some 3D object using paths I generated so it locked in one of perspectives similar to what I get now in 2D.

So how do I dynamically construct 3D object by adding paths?

BTW: actually I ment algorithm like this http://www.derschmale.com/2009/07/20/slice-based-volume-rendering-using-pixel-bender/

So I want to create from such PATH (I do not want to use images and I do not want to use flash I want to use Java + OpenGl)

alt text

such 3d image (But note I want openGL Java and Path’s))

alt text

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:43:43+00:00Added an answer on May 13, 2026 at 7:43 pm

    I’m not sure I understand what you’re after.

    The example you supplied draws 2d paths, but merely uses z. scaling would have worked
    in a similar way.

    So How to dinamicly construct 3d
    object by adding path’s ?

    Do you mean extruding/lathing an object, or replicating the scrunch sketch ?

    Drawing a path is easy in processing, you just place vertex objects, in a for loop
    between beginShape() and endShape() calls.

    Here is the bit of code that does that in the example you’ve sent:

     beginShape(); 
      for (int p=0; p<pcount; p++){ 
        vertex(Ring[p].position().x(),Ring[p].position().y()); 
      } 
      endShape(CLOSE);
    

    you can also call vertex(x,y,z)

    I wanted to extrude a path a while back, here is my question in case it helps.

    Basic sketch is uploaded here.

    EDIT:
    If you have an array of 2 polygons, you can just loop through them, and draw
    using something similar to beginShape() and endShape(), GL_POLYGON might be handy.

    e.g.

    import processing.opengl.*;
    import javax.media.opengl.*;
    
    int zSpacing = 10;
    PVector[][] slices;
    
    void setup() {
      size(600, 500, OPENGL);
    
      slices = new PVector[3][3];
      //dummy slice 1
      slices[0][0] = new PVector(400, 200,-200);
      slices[0][1] = new PVector(300, 400,-200);
      slices[0][2] = new PVector(500, 400,-200);
      //dummy slice 2
      slices[1][0] = new PVector(410, 210,-200);
      slices[1][1] = new PVector(310, 410,-200);
      slices[1][2] = new PVector(510, 410,-200);
      //dummy slice 3
      slices[2][0] = new PVector(420, 220,-200);
      slices[2][1] = new PVector(320, 420,-200);
      slices[2][2] = new PVector(520, 420,-200);
    }
    
    void draw() {
      background(255);
    
      PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;  // g may change
      GL gl = pgl.beginGL();  // always use the GL object returned by beginGL
    
      for(int i = 0 ; i < slices.length; i ++){
        gl.glColor3f(0, .15 * i, 0);
        gl.glBegin(GL.GL_POLYGON);
        for(int j = 0; j < slices[i].length; j++){
          gl.glVertex3f(slices[i][j].x, slices[i][j].y,slices[i][j].z + (zSpacing * i));
        }
        gl.glEnd();
      }
      pgl.endGL();
    }
    

    The idea is you loop through each slice, and for each slice your loop through all its points. Obviously slices and the number of 3d vectors inside each slice is up to your data. Speaking of which, where does your data come from ?

    If slices is not what your after volTron could come in handy:
    volTron http://dm.ncl.ac.uk/joescully/voltronlib/images/s2.jpg

    HTH,
    George

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some classes layed out like this class A { public virtual void
I have some code like this in a winforms app I was writing to
In tcsh , I have the following script working: #!/bin/tcsh setenv X_ROOT /some/specified/path setenv
I have some ASP.NET web services which all share a common helper class they
I have some C# / asp.net code I inherited which has a textbox which
I have some UI in VB 2005 that looks great in XP Style, but
I have some code for starting a thread on the .NET CF 2.0: ThreadStart
We have some input data that sometimes appears with &nbsp characters on the end.
I have some kind of test data and want to create a unit test
We have some files on our website that users of our software can download.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.