graphics

how should i handle (morphing) 4D objects in opengl? [closed]

佐手、 提交于 2019-12-13 03:40:00
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 months ago . i want to try writing a playground similar to this 4D toys, so i started learning opengl. from my current understanding, people use VBOs and uniform transformation matrix for mostly-static objects (like cubes, skeletal animations etc., which usually just involves transformations)

Algorthim to create a mesh between two sets of points

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 03:34:38
问题 Is there an algorithm to create a mesh between two lists of 3D points, each list forms a full loop? Example Image In the linked image the Red dots are the first set and the blue are the second, the grey is the desired output of triangles connecting the two sets filling the gap between. This image shows what I would like to do exactly in 3d , The purple points form the outline of the first terrain and the other points forms the outline of a hole in the second terrain, the algorithm should

Adding Images on Mouse Click to JPanel

孤街醉人 提交于 2019-12-13 03:19:58
问题 I am working with Swing for the first time and am having a bit of an issue. What I have is a JFrame split into four JPanels. There is a MouseListener on the JFrame that acts like this On a click, if the click is inside of the left hand bar, determine which of the 13 icons is being selected. If the click is inside the right hand "game pane" & an icon has been selected, place it at the location clicked. This is done here @Override public void mouseClicked(MouseEvent event) { // TODO Auto

Java - get Graphics

我的梦境 提交于 2019-12-13 02:50:26
问题 im making a java swing game. I heard that swing components don't use active rendering(you can only override paint methods), and for that reason, i have been using BufferStrategy with Canvas. Now i have discover the getGraphics() method from JComponent and JPanel. If we can do active render in swing components, why game tutorials still override paint() and paintComponent() ? 回答1: Don't EVER use getGraphics , it can return null and is nothing more the a snap-shot of the last paint cycle.

PipeGame -Why are the game objects not moving?

流过昼夜 提交于 2019-12-13 02:37:15
问题 I'm wondering why my game objects are not showing. I am able to draw to the JPanel if I use g.drawRect outside of the for-each loop, but calling PipeObject inside of the loop doesn't seem to work for me. Am I doing something wrong here? Thanks for any help or solutions. This is an updated version of my old question, which can be found here. UPDATE - The pipes are drawing correctly, but not moving to the left by calling pipe.move() . Game import java.awt.*; import java.awt.event.ActionEvent;

How can I compile code that uses graphics.h in DOSBOX?

妖精的绣舞 提交于 2019-12-13 02:26:41
问题 i write a code and in this code i use graphics.h ,in borland c++ or visual I can't open and run it, now i want run this code ,and i have DOSBOX 0.72 , how open this code with DOSBOX? my windows is 7 32bit 回答1: I see you're still trying to write and compile code that uses legacy and unsupported libraries... At least you've discovered now that you aren't going to be able to do this natively in Windows 7, and have installed a DOS emulator. Now, you'll need to find and download a compiler that

How to draw on canvas greater than screen size and be able to scroll / pan horizontally and vertically in android?

牧云@^-^@ 提交于 2019-12-13 02:26:19
问题 I am looking for a real example with sample code on how to draw on canvas greater than screen size ( As of now I am drawing normally and not able to view outside screen size). More stress is on being able to scroll / pan the screen to view the whole canvas. If anymore info is required please comment. Update: Found my answer here Image in Canvas with touch events 回答1: My version is converted from Monodroid, but the implementation should look about the same. (I tried putting it back into java,

Reliable / Popular data visualization toolkit for the web

梦想的初衷 提交于 2019-12-13 02:20:38
问题 I'm looking for a reliable toolkit in any web-neutral[A] language, actively maintained / developed, stable that allows me to build graphs, charts, display data dynamically, allow drag-n-drop of datasets and refreshes automatically. Carlos Scheidegger recommended - http://vis.stanford.edu/protovis/ which looks great! But I'm looking to see what others are there and what ppl are using... [A] What I mean is something like js / jquery, etc. which can be generated by any web language like php,

How to rotate a line based on a given number of degrees

纵饮孤独 提交于 2019-12-13 02:15:20
问题 I have a line drawn with a Graphics object. I want to rotate this line a certain amount of degrees based on how much the mouse is dragged. I can get the number of degrees i need to rotate it but how do i then rotate the line based on that? Thank You! 回答1: You can create a Line2D object for your original line. Then you can use AffineTransform#getRotateInstance to obtain an AffineTransform that does the rotation about a certain angle, around a certain point. Using this AffineTransform , you can

Over-riding the background() function in p5.js?

孤者浪人 提交于 2019-12-13 01:38:33
问题 I made a galaxy sketch in p5.js using rotates and radians, but it's erased each time the background() is loaded as draw() runs. Is there a way to over-ride the background() function? I want the galaxies to remain in view. var stars; function preload(){ //for (var i = 0; i < planetArray.length; i++) { //stars = loadImage('Assets/stars.png'); } function setup(){ createCanvas(windowWidth, windowHeight); } function draw() { //background(0); star() //function mousepressed(){ } function star(){ /