Search Results

Search found 683 results on 28 pages for 'justin garrison'.

Page 6/28 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Where to store front-end data for "object calculator"

    - by Justin Grahn
    I recently have completed a language library that acts as a giant filter for food items, and flows a bit like this :Products -> Recipes -> MenuItems -> Meals and finally, upon submission, creates an Order. I have also completed a database structure that stores all the pertinent information to each class, and seems to fit my needs. The issue I'm having is linking the two. I imagined all of the information being local to each instance of the product, where there exists one backend user who edits and manipulates data, and multiple front end users who select their Meal(s) to create an Order. Ideally, all of the front end users would have all of this information stored locally within the library, and would update the library on startup from a database. How should I go about storing the data so that I can load it into the library every time the user opens the application? Do I package a database onboard and just load and populate every time? The only method I can currently conceive of doing this, even if I only have 500 possible Product objects, would require me to foreach the list for every Product that I need to match to a Recipe and so on and so forth every time I relaunch the program, which seems like a lot of wasteful loading. Here is a general flow of my architecture: Products: public class Product : IPortionable { public Product(string n, uint pNumber = 0) { name = n; productNumber = pNumber; } public string name { get; set; } public uint productNumber { get; set; } } Recipes: public Recipe(string n, decimal yieldAmt, Volume.Unit unit) { name = n; yield = new Volume(yieldAmt, unit); yield.ConvertUnit(); } /// <summary> /// Creates a new ingredient object /// </summary> /// <param name="n">Name</param> /// <param name="yieldAmt">Recipe Yield</param> /// <param name="unit">Unit of Yield</param> public Recipe(string n, decimal yieldAmt, Weight.Unit unit) { name = n; yield = new Weight(yieldAmt, unit); } public Recipe(Recipe r) { name = r.name; yield = r.yield; ingredients = r.ingredients; } public string name { get; set; } public IMeasure yield; public Dictionary<IPortionable, IMeasure> ingredients = new Dictionary<IPortionable,IMeasure>(); MenuItems: public abstract class MenuItem : IScalable { public static string title = null; public string name { get; set; } public decimal maxPortionSize { get; set; } public decimal minPortionSize { get; set; } public Dictionary<IPortionable, IMeasure> ingredients = new Dictionary<IPortionable, IMeasure>(); and Meal: public class Meal { public Meal(int guests) { guestCount = guests; } public int guestCount { get; private set; } //TODO: Make a new MainCourse class that holds pasta and Entree public Dictionary<string, int> counts = new Dictionary<string, int>(){ {MainCourse.title, 0}, {Side.title , 0}, {Appetizer.title, 0} }; public List<MenuItem> items = new List<MenuItem>(); The Database just stores and links each of these basic names and amounts together usings ID's (RecipeID, ProductID and MenuItemID)

    Read the article

  • JavaOne + Develop Registration is Open!

    - by justin.kestelyn
    Welcome to "The Zone". Here's what the new JavaOne + Develop registration Website says: The world's most important developer conferences are creating the world's coolest neighborhood for the developer community. Having been intimately involved in the planning process, I can vouch for that statement. Remember, if either co-located conference - JavaOne or Oracle Develop - are the confines of your interest, you can experience either one in standalone mode, if you like (although there are some areas of common interest, of course). Or, considering that a single Full Conference Pass gives you access to both of them, you can partake in any measure that you like. It's up to you. Either way, you will get access not only to session content and keynotes, but also to the massive OTN Night party on Monday night, to open unconference sessions, and to the legendary Appreciate Night concert (acts TBD) on Wednesday. Furthermore, as is customary, the Oracle Technology Network team will offer a full slate of community-focused activities and goodies while the conferences are running - more details on those as we have them. A GOOD time is ensured for all; I look forward to seeing you there!

    Read the article

  • Liberate Your Laptops! The Return of Virtual Developer Day

    - by Justin Kestelyn
    Many enterprises are reducing travel, conference, and training budgets for their developers without any change in expectation for the results those developers must deliver. How can you keep up? Well, some months back we offered you a Virtual Developer Day on the subject of building Rich Enterprise Applications, the key piece of which was free access to a cloud development environment for hands-on. Now it's back, new and improved! Join us for a FREE, online, multi-language event series for developers (English version is on July 27) at Oracle Technology Network 's Virtual Developer Day. This unique one-day event provides you the opportunity to: 1. Get trained on Oracle Tuxedo from the comfort of your laptop 2. Get hands-on, locally with Oracle VM VirtualBox or via the Cloud 3. Learn what Python, Ruby, and PHP have to do with Oracle Tuxedo 4. Network online with peers, Oracle Tuxedo architects and developers worldwide 5. Sessions, Labs, and Live Help in LOCAL Languages! Review the agenda details, dates, and language support options. Space is limited, so register for this event now! For information and to register go to: www.oracle.com/goto/otnvdd

    Read the article

  • Precision loss when transforming from cartesian to isometric

    - by Justin Skiles
    My goal is to display a tile map in isometric projection. This tile map has 25 tiles across and 25 tiles down. Each tile is 32x32. See below for how I'm accomplishing this. World Space World Space to Screen Space Rotation (45 degrees) Using a 2D rotation matrix, I use the following: double rotation = Math.PI / 4; double rotatedX = ((tileWorldX * Math.Cos(rotation)) - ((tileWorldY * Math.Sin(rotation))); double rotatedY = ((tileWorldX * Math.Sin(rotation)) + (tileWorldY * Math.Cos(rotation))); World Space to Screen Space Scale (Y-axis reduced by 50%) Here I simply scale down the Y value by a factor of 0.5. Problem And it works, kind of. There are some tiny 1px-2px gaps between some of the tiles when rendering. I think there's some precision loss somewhere, or I'm not understanding how to get these tiles to fit together perfectly. I'm not truncating or converting my values to non-decimal types until I absolutely have to (when I pass to the render method, which only takes integers). I'm not sure how to guarantee pixel perfect rendering precision when I'm rotating and scaling on a level of higher precision. Any advice? Do I need to supply for information?

    Read the article

  • Virtual Developer Day: Oracle WebLogic Server & Java EE (#OTNVDD)

    - by Justin Kestelyn
    Virtual Developer Day is back with a vengeance! On Feb. 1, login to learn how Oracle WebLogic Server enables a whole new level of productivity for enterprise developers. Also hear the latest on Java EE 6 and the programming tenets that have made it a true platform breakthrough, and get hands-on with our VirtualBox virtual machine image! Even better, you never have to leave your desk - you'll get access to live sessions with chat support, and even 1-1 desktop sharing upon request. It's a no-brainer, get registered!

    Read the article

  • Get Your Workshop Hands On!

    - by Justin Kestelyn
    Now that 2010 is behind us, that means a fresh set of Developer Day workshops (still free, always free) are ahead of us! Developer Day workshops are free, hands-on workshops that give you the software and skills to tame that learning curve and reach the next level in your technical knowledge. We have a range of entrees on the menu, including Java Development, Database Application Development, Fusion Development (Oracle ADF), and more. Most of these workshops let you walk away with a fully functional, VirtualBox-based software appliance that you can use for continued learning. Here's a short list of workshops for which you can register right now: - Java: Boston, March 8- Database App Development: Dallas, March 9- SOA Development: Reston, March 9- Data Integration: Seattle, March 15 + others planned for Toronto, Philadelphia, Shanghai, Perth, Istanbul, and many other cities in 2011! See this URL for more workshop info as it becomes available.

    Read the article

  • How to write your unit tests to switch between NUnit and MSTest

    - by Justin Jones
    On my current project I found it useful to use both NUnit and MsTest for unit testing. When using ReSharper for running unit tests, it just simply works better with NUnit, and on large scale projects NUnit tends to run faster. We would have just simply used NUnit for everything, but MSTest gave us a few bonuses out of the box that were hard to pass up. Namely code coverage (without having to shell out thousands of extra dollars for the privilege) and integrated tests into the build process. I’m one of those guys who wants the build to fail if the unit tests don’t pass. If they don’t pass, there’s no point in sending that build on to QA. So making the build work with MsTest is easiest if you just create a unit test project in your solution. This adds the right references and project type Guids in the project file so that everything just automagically just works. Then (using NuGet of course) you add in NUnit. At the top of your test file, remove the using statements that refer to MsTest and replace it with the following: #if NUNIT using NUnit.Framework; #else using TestFixture = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute; using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute; using TestFixtureSetUp = Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute; using SetUp = Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute; using Microsoft.VisualStudio.TestTools.UnitTesting; #endif Basically I’m taking the NUnit naming conventions, and redirecting them to MsTest. You can go the other way, of course. I only chose this direction because I had already written the tests as NUnit tests. NUnit and MsTest provide largely the same functionality with slightly differing class names. There’s few actual differences between then, and I have not run into them on this project so far. To run the tests as NUnit tests, simply open up the project properties tab and add the compiler directive NUNIT. Remove it, and you’re back in MsTest land.

    Read the article

  • I am having a error with installing everything!

    - by Justin Baskaran
    Everytime I go to install wine, playonlinux I get this error:![enter image description here][1] Then I get other variations too but this altogether... People on other posts say I have to do a clean install is this right...I dont want to but if I have too I will... Pakcage dependencies cannot be resolved This error could be caused by required additonal software pakcages... details the following packages have unment dependencies: playonlinux

    Read the article

  • Putting DSMD into Remission

    - by Justin Greenwood
    As a programmer with over ten years of professional experience, I've often suffered from DSMD (distraction surplus/motivation deficit) disorder. I know I'm not alone. Many of my colleagues have shared their experiences with this productivity cancer to me in support groups or in moments of inebriated intimacy. Often, I observe friends unknowingly surrendering to it - sitting at their computer, cycling through the same set of web sites (blogs, facebook, youtube, news providers, wikipeida, etc.), over and over again. Intermittently, they get up, take a walk around the office, make small talk with their colleagues, get another cup of coffee, then sit down and start the cycle all over again. It is completely controlled by the subconscious mind and will destroy your ability to get into that groove you used to live in back in your better days. Programming requires extended periods of focused attention, and this type of behavior will really kill productivity and in the end, when deadlines are near, launch your stress level to near emotional breakdown levels.DiagnosisThe best way to diagnose infection is to completely disconnect your devices from the internet while working. If you find yourself launching web browsers every minute or so, then you're down with the sickness.TreatmentA few techniques I've found that will help send this ailment into regression are as follows:Segment your day into two to three hour work segments. For example: 9:00-11:00, 1:00-3:00, 3:30-5:00.Define a few small one to two hour tasks you want to accomplish in your day. Assign each of those tasks to one of the short work segments.If possible, turn off the internet and any other distractions during these work segments (at least until you regain control of your browsing habits) - this includes instant messaging and email. You can check your email and waste time surfing in the hours between work segments.Reward yourself on productive days with a beer or whatever butters your muffins.

    Read the article

  • Is there a cheaper non-express non-student, non-msdn version of Visual Studio 2010 that supports plugins in the US than the $710 Professional Edition?

    - by Justin Dearing
    I've never actually purchased a copy of Visual Studio myself. SharpDevelop and Express edition have always been good enough for my personal use, and my employers always furnished me with the IDEs I needed to serve them. However, I'm thinking of actually paying for a copy for my personal laptop. I need this mainly so I can open solutions that contain web projects. So my question is: Is there an edition cheaper than the $710 Pro edition on Amazon that will do what I need: http://www.amazon.com/Microsoft-C5E-00521-Visual-Studio-Professional/dp/B0038KTO8S/ref=sr_1_2?ie=UTF8&qid=1287456230&sr=8-2 ? What I need is defined as: Open up a solution with C#, Web App, VB.NET, and Web Projects. Install addins like resharper, testdriven.net, etc, SCM plugins, etc. Some level of db project support. At least to be able to open a dbproj. I only need that for SCM hooks. SSMS and SQLCMD are good enough for actually editing databases. Ability to install F#, IronPython, IronRuby etc. Now naturally I'm a fairly intelligent resourceful person so I realize I can get Visual Studio in a questionable manner. Thats not what I'm looking to do. I want a legal copy, I don't want a student copy, or an MSDN copy. I want a real copy, I just want to make sure I get the cheapest edition that serves my needs.

    Read the article

  • Syncing client and server CRUD operations using json and php

    - by Justin
    I'm working on some code to sync the state of models between client (being a javascript application) and server. Often I end up writing redundant code to track the client and server objects so I can map the client supplied data to the server models. Below is some code I am thinking about implementing to help. What I don't like about the below code is that this method won't handle nested relationships very well, I would have to create multiple object trackers. One work around is for each server model after creating or loading, simply do $model->clientId = $clientId; IMO this is a nasty hack and I want to avoid it. Adding a setCientId method to all my model object would be another way to make it less hacky, but this seems like overkill to me. Really clientIds are only good for inserting/updating data in some scenarios. I could go with a decorator pattern but auto generating a proxy class seems a bit involved. I could use a generic proxy class that uses a __call function to allow for original object data to be accessed, but this seems wrong too. Any thoughts or comments? $clientData = '[{name: "Bob", action: "update", id: 1, clientId: 200}, {name:"Susan", action:"create", clientId: 131} ]'; $jsonObjs = json_decode($clientData); $objectTracker = new ObjectTracker(); $objectTracker->trackClientObjs($jsonObjs); $query = $this->em->createQuery("SELECT x FROM Application_Model_User x WHERE x.id IN (:ids)"); $query->setParameters("ids",$objectTracker->getClientSpecifiedServerIds()); $models = $query->getResults(); //Apply client data to server model foreach ($models as $model) { $clientModel = $objectTracker->getClientJsonObj($model->getId()); ... } //Create new models and persist foreach($objectTracker->getNewClientObjs() as $newClientObj) { $model = new Application_Model_User(); .... $em->persist($model); $objectTracker->trackServerObj($model); } $em->flush(); $resourceResponse = $objectTracker->createResourceResponse(); //Id mappings will be an associtave array representing server id resources with client side // id. //This method Dosen't seem to flexible if we want to return additional data with each resource... //Would have to modify the returned data structure, seems like tight coupling... //Ex return value: //[{clientId: 200, id:1} , {clientId: 131, id: 33}];

    Read the article

  • Which 3D file formats support multiple animations? [on hold]

    - by Justin
    I'm working on a 3D application that uses Assimp to import 3D models with animations. Personally, I use Blender to create the models and animations. I'm having trouble exporting multiple animations, however. For example, I'd like to have an idle animation, a walk animation, a run animation, etc. So far I've tried COLLADA and DirectX without much success. The COLLADA export will include the first animation, but not any of the others. The DirectX doesn't include any animation. Which 3D file formats support multiple animations? (Preferably one that Assimp can import. Also, the Assimp website says that it doesn't support .blend files with animation, otherwise I'd just do that.)

    Read the article

  • What is a good way to keep track of strings for dictionary lookups?

    - by Justin
    I am working through the Windows 8 app tutorial. They have some code about saving app data like so: private void NameInput_TextChanged(object sender, TextChangedEventArgs e) { Windows.Storage.ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; roamingSettings.Values["userName"] = nameInput.Text; } I have worked with C# in the past and found that things like using constant string values (like "userName" in this case) for keys could get messy because auto-complete did not work and it was easy to forget if I had made an entry for a setting before and what it was called. So if I don't touch code for awhile I end up accidentally creating multiple entries for the same value that are named slightly differently. Surely there is a better way to keep track of the strings that key to those values. What is a good solution to this problem?

    Read the article

  • Remember way back when we had a free decompiler?

    - by Justin Jones
    I, like probably so many of the rest of you, was mortified when Reflector was sold to RedGate. I knew where it was going. Suddenly you had to install it instead of just download and run it. I had a deep down feeling that one of the most useful tools in my arsenal was about to become a corporate product and no longer belong to the world of free tools. Sure enough it did. For a while now I’ve limped by without my favorite decompiler. This was made a little easier by the fact that you can now debug into the .net framework, but I still missed Reflector. JetBrains, makers of the superawesome and well worth the cost ReSharper (no it’s not free) have made their own decompiler that is comparable with Reflector, and it’s free. It’s still a corporate product, and JetBrains isn’t exactly known for making free software, but for now we have an option back on the table until some other industrious developer makes the next Reflector. dotPeek can be downloaded here.  http://www.jetbrains.com/decompiler/

    Read the article

  • 11.10 7600gt display error

    - by Justin Ray
    So i used to use Ubuntu back when it was 8 and it never gave me any problems but recently i did a fresh install of 11.10. But now when i install the N-Vidia restricted drivers i cant change my screen resolution from 640x480, the display menu says "can not detect display". There is no way to navigate the screen really because the windows don't work and I'm not very command prompt keen please help i love Ubuntu!

    Read the article

  • Service layer coupling

    - by Justin
    I am working on writing a service layer for an order system in php. It's the typical scenario, you have an Order that can have multiple Line Items. So lets say a request is received to store a line item with pictures and comments. I might receive a json request such as { 'type': 'Bike', 'color': 'Red', 'commentIds': [3193,3194] 'attachmentIds': [123,413] } My idea was to have a Service_LineItem_Bike class that knows how to take the json data and store an entity for a bike. My question is, the Service_LineItem class now needs to fetch comments and file attachments, and store the relationships. Service_LineItem seems like it should interact with a Service_Comment and a Service_FileUpload. Should instances of these two other services be instantiated and passed to the Service_LineItem constructor,or set by getters and setters? Dependency injection seems like the right solution, allowing a service access to a 'service fetching helper' seems wrong, and this should stay at the application level. I am using Doctrine 2 as a ORM, and I can technically write a dql query inside Service_LineItem to fetch the comments and file uploads necessary for the association, but this seems like it would have a tighter coupling, rather then leaving this up to the right service object.

    Read the article

  • restarted my computer and my wireless icon was missing and my sound no longer works

    - by Justin Otto
    I recently updated to 12.04 on my sony vaio VGN-N110G. I've had ubuntu on this laptop since 10.04 and haven't had any real problems. so i restarted my computer today and none of the unity desktop background showed up only the desktop with the files on it so i brought up the terminal and entered in unity -replace and restarted it and it came back up fine except that i noticed that my panel only had mail, volume, date/time, and power icons no wireless or bluetooth, i tried a couple of approaches to try and get it working again i tried nm-applet --sm-disable and it brought up a warning message, i'm not very skilled in code even though i've had ubuntu for four years but in the past versions it wasn't too big a problem

    Read the article

  • Should all public methods in an abstract class be marked virtual?

    - by Justin Pihony
    I recently had to update an abstract base class on some OSS that I was using so that it was more testable by making them virtual (I could not use an interface as it combined two). This got me thinking whether I should mark all of the methods that I needed virtual, or if I should mark every public method/property virtual. I generally agree with Roy Osherove that every method should be made virtual, but I came across this article that got me thinking about whether this was necessary or not. I am going to limit this down to abstract classes for simplicity, however (whether all concrete public methods should be virtual is especially debatable, I am sure). I could see where you might want to allow a sub-class to use a method, but not want it overriding the implementation. However, as long as you trust that Liskov's Substitution Principle will be followed, then why would you not allow it to be overriden? By marking it abstract, you are forcing a certain override anyway, so, it seems to me that all public methods inside of an abstract class should indeed be marked virtual. However, I wanted to ask in case there was something I might not be thinking. Should all public methods within an abstract class be made virtual?

    Read the article

  • Next lowest value in MySQL Database [migrated]

    - by Justin Edwards
    SELECT * FROM `experience` WHERE `reqexp` <> '4793' ORDER BY 'lvl' DESC LIMIT 1 Here is what I want to do. I am making an online game for a client, and need to be able to use a mysql query with a random value, and find the level associated with that amount of experience. In this case, I need to find the next value lower than 4793 that already exists in the database so I can determine the players appropriate level. Any Ideas?

    Read the article

  • How to estimate effort required to convert a large codebase to another language/platform

    - by Justin Branch
    We have an MFC C++ program with around 200,000 lines of code in it. It's pretty much finished. We'd like to hire someone to convert it to work for Macs, but we are not sure how to properly estimate a reasonable timeline for this project. What techniques can we use to estimate what it would take to convert this project to work on a Mac? Also, is there anything in particular we should be watching out for specific to this sort of conversion?

    Read the article

  • Why does Google Analytics log a user logging in as an exit?

    - by Justin
    I have custom event tracking set up in Google Analytics that tracks when a visitor registers on the site. The tracking is working fine. However, GA is showing that 100% of users "exit" the site after registering. They aren't exiting however, they are just getting logged in. Is there some reason why a user creating a session by logging in would cause GA to lose track of the visitor and think a new user had arrived? Is there any way to prevent this?

    Read the article

  • Ubuntu 12.04 USB wireless not recognized

    - by Justin
    I have searched for awhile now for ways to fix my problem but have come up with nothing. I am running Ubuntu 12.04 on my desktop computer. I am unable to find the Enable Wireless button in the network area. It just doesn't appear. Everything else works on my laptop. I believe it's the drivers for my USB network adapter. I also have no way of using a wired connection at the moment. Thanks for any help!

    Read the article

  • Understanding exceptional cases

    - by Justin
    I've been studying the use of exceptions in various php projects (such as Doctrine and Zend Framework). Exceptions seem to be thrown when unordinary input/state occurs. A perfect example is Doctrine throwing an exception when you try to use a invalid query string. I think the creators of the doctrine api understood that first, you can't query data by using an invalid DQL statement, and a developer should immediately be warned that an error has occurred, rather then letting execution continue with the possibility of an error code going un-checked. I also bet that this simplifies reading the code. I can't think of a situation where you would want to use an invalid DQL statement, except unit testing. Since this is true, it's better to avoid plaguing a bunch of code with null/error checks and use exceptions. I've read in books that exceptions shouldn't be thrown when validating dating user input. I've seen examples where of where the guideline is broken. One example is the Zend framework. If supplying an invalid controller or action name, an exception is thrown. Unlike doctrine, the user has more direct control over this sort of input. I know you can configure an error controller and set up a 404 message or what have you, but I'm curious why they have used an exception in this scenario? I guess you can argue the Zend Framework does not know how to continue processing the quest. One last example Is I wrote a function to return some html based on a given resource type. This resource type is hard-coded and sent when a user interacts with a web site (such as clicking a button to display the form to input data). I don't expect users to be mucking around with the request type. Under normal operating conditions, the resource type should be valid. To clean up some logic, I was going to throw an exception if a particular form wasn't found. This is mainly to find the correct form associated with a resource type so proper validation can occur. Does this sound like a valid use case for an exception? Right now it's pretty trivial, but I do plan to implement a restful consumer and re-using a function to map resources to their validation services would be very useful. I can then catch the exception and based on the consumer, return an error message suitable for the request type...

    Read the article

  • Advice on reconciling discordant data

    - by Justin
    Let me support my question with a quick scenario. We're writing an app for family meal planning. We'll produce daily plans with a target calorie goal and meals to achieve it for our nuclear family. Our calorie goal will be calculated for each person from their attributes (gender, age, weight, activity level). The weight attribute is the simplest example here. When Dad (the fascist nerd who is inflicting this on his family) first uses the application he throws approximate values into it for Daughter. He thinks she is 5'2" (157 cm) and 125 lbs (56kg). The next day Mom sits down to generate the menu and looks back over what the bumbling Dad did, quietly fumes that he can never recall anything about the family, and says the value is really 118 lbs! This is the first introduction of the discord. It seems, in this scenario, Mom is probably more correct that Dad. Though both are only an approximation of the actual value. The next day the dear Daughter decides to use the program and sees her weight listed. With the vanity only a teenager could muster she changes the weight to 110 lbs. Later that day the Mom returns home from a doctor's visit the Daughter needed and decides that it would be a good idea to update her Daughter's weight in the program. Hooray, another value, this time 117 lbs. Now how do you reconcile these data points? Measurement error, confidence in parties, bias, and more all confound the data. In some idealized world we'd have a weight authority of some nature providing the one and only truth. How about in our world though? And the icing on the cake is that this single data point changes over time. How have you guys solved or managed this conflict?

    Read the article

  • GLSL per pixel lighting with custom light type

    - by Justin
    Ok, I am having a big problem here. I just got into GLSL yesterday, so the code will be terrible, I'm sure. Basically, I am attempting to make a light that can be passed into the fragment shader (for learning purposes). I have four input values: one for the position of the light, one for the color, one for the distance it can travel, and one for the intensity. I want to find the distance between the light and the fragment, then calculate the color from there. The code I have gives me a simply gorgeous ring of light that get's twisted and widened as the matrix is modified. I love the results, but it is not even close to what I am after. I want the light to be moved with all of the vertices, so it is always in the same place in relation to the objects. I can easily take it from there, but getting that to work seems to be impossible with my current structure. Can somebody give me a few pointers (pun not intended)? Vertex shader: attribute vec4 position; attribute vec4 color; attribute vec2 textureCoordinates; varying vec4 colorVarying; varying vec2 texturePosition; varying vec4 fposition; varying vec4 lightPosition; varying float lightDistance; varying float lightIntensity; varying vec4 lightColor; void main() { vec4 ECposition = gl_ModelViewMatrix * gl_Vertex; vec3 tnorm = normalize(vec3 (gl_NormalMatrix * gl_Normal)); fposition = ftransform(); gl_Position = fposition; gl_TexCoord[0] = gl_MultiTexCoord0; fposition = ECposition; lightPosition = vec4(0.0, 0.0, 5.0, 0.0) * gl_ModelViewMatrix * gl_Vertex; lightDistance = 5.0; lightIntensity = 1.0; lightColor = vec4(0.2, 0.2, 0.2, 1.0); } Fragment shader: varying vec4 colorVarying; varying vec2 texturePosition; varying vec4 fposition; varying vec4 lightPosition; varying float lightDistance; varying float lightIntensity; varying vec4 lightColor; uniform sampler2D texture; void main() { float l_distance = sqrt((gl_FragCoord.x * lightPosition.x) + (gl_FragCoord.y * lightPosition.y) + (gl_FragCoord.z * lightPosition.z)); float l_value = lightIntensity / (l_distance / lightDistance); vec4 l_color = vec4(l_value * lightColor.r, l_value * lightColor.g, l_value * lightColor.b, l_value * lightColor.a); vec4 color; color = texture2D(texture, gl_TexCoord[0].st); gl_FragColor = l_color * color; //gl_FragColor = fposition; }

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >