Jump to content

  • Log In with Google      Sign In   
  • Create Account

MarekKnows.com

Member Since 09 Dec 2005
Offline Last Active Feb 01 2016 09:19 PM

Topics I've Started

How to implement GLSL marching ant shader

01 February 2016 - 05:53 AM

I'm making a PC 2D point and click adventure and I would like to have a UI where if the user hovers their mouse cursor over an object (that can be interacted with) the object would be rendered with a highlight selection around it... Something like marching ants.

I'm thinking this could be implemented like this:

* start render frame
* Render all objects appearing behind the selected item using the "normal" shader.
* switch to selection shader and render the item
* switch back to "normal" shader and render all items that appear in front of the selected object

All my graphic assets are 2D hand drawn textures.

Any ideas on how to implement the selection shader in GLSL?

web api needed for drawing 2D schematic diagrams

02 November 2015 - 02:22 PM

I'm not sure which the the appropriate thread to post this question in, so please move it if this place is not correct.
 
I have some software that I would like to move onto the web by making it run in a browser.  The software that I have is based on drawing a 2D diagram by dropping blocks onto the screen and then connecting the blocks with lines to define logic flow. Similar to how Unreal's blueprint visual scripting works.
 
Does anyone know of some web api that I could code against to make this happen?  I don't want to recreate the wheel if someone has already invented it.  Sample website that have the functionality that I need include:
 
 
 
 
 

help passing class into std::thread arguments

23 October 2015 - 02:51 PM

See code snippet below:

 

class A {
public:
   A() {
      std::cout << "A is constructed" << std::endl;
   }

   ~A() {
      std::cout << "A is destroyed" << std::endl;
   }
};

static void foo( A a ) { 
   std::cout << "inside foo" << std::endl;
}

int _tmain(int argc, _TCHAR* argv[]) {
   A a;
   std::thread( foo, a ).detach(); 

   std::this_thread::sleep_for( std::chrono::seconds( 2 ) );

   return 0;
}

The console output that I see is:

 

A is constructed
inside foo
A is destroyed
A is destroyed
A is destroyed
A is destroyed
A is destroyed
A is destroyed
Press any key to continue . . .

I create an instance of A and then try to pass it into a new thread.  I pause my main thread for 2 seconds and then I quit.  Why is the A destructor called so many times, but the constructor is only called once? 

 

I should mention that I'm using VS2013 on Windows 7.


Moving Java app onto the Web

01 October 2015 - 11:13 AM

I am working on a Java application that uses the jMonkeyEngine (v1) for its 3D visualization and it ties in with another piece of software that is written in C++. The code base is about 8 years old now. The client has shown interest in moving their application onto the Internet.
 
So my question is this, which online technologies should I look at to be able to make this move as smooth as possible? I realize that I'll probably need to rewrite most if not all of the code to make this happen (in WebGL?).
 
Has anyone done this sort of thing in the past that can give me tips on things to look out for?
 
Any suggested libraries that I should investigate? I'm currently looking at:
 

How to find projection plane for 3d points

16 July 2015 - 02:38 PM

I have a set of points defined in 3D space.  I’d like to find the optimal plane for which I could project all of these 3d points onto and have them “nicely” spaced out.  I realize that there may not be an optimal solution if all my points are poorly spatially distributed. As a simple example, imagine we have points (illustrated as white dots below) such that they encircle a sphere.

 

Attached File  points.jpg   29.63KB   2 downloads

 

I’d like to find the cross section plane that is illustrated in the image below.   Could someone suggest how we could find this plane given only the x,y,z coordinates of the 3d points?

 

Attached File  plane.jpg   28.71KB   2 downloads

 


PARTNERS